Reputation: 359
I am unable to run ng serve command on Windows 10
I have successfully installed npm and node
I am trying to install angular on Windows 10.
1- My node version is
node -v
v10.16.0
and npm version is
npm -v
6.9.0
After running command of angular cli which is
npm install -g @angular/cli
I am not able to run ng serve command. It show this error
'ng' is not recognized as an internal or external command,
operable program or batch file.
I have looked some online solutions which says to set 'PATH` but my path npm folder is empty
C:\Users\shaha\AppData\Roaming\npm
I have tried many times uninstallation and installation of nodejs but I am unable to run ng serve command. Please help me to solve this issue.
Upvotes: 2
Views: 3676
Reputation: 197
Its because of environment path setup
For now you can use npm run ng serve
command
Upvotes: 1
Reputation: 7080
Run the following the command to know npm default path
npm config get prefix
If the path is different than AppData/npm then change it
npm config set prefix "$APPDATA\npm"
And again run npm config get prefix
to get current path then set it to Environment Variables and restart the system
You will need to log out then log back in for the change to your PATH variable to take effect.
Upvotes: 0