enter image description here I am not able build the angular project in visual studio using ng serve,but I am able to do it using node.js command prompt please give me solutions for this one
Asked
Active
Viewed 4,915 times
1
-
1possible duplicate https://stackoverflow.com/questions/27864040/fixing-npm-path-in-windows-8-and-10/32159233 – Aritra Chakraborty Aug 17 '18 at 06:36
-
1Possible duplicate of [Fixing npm path in Windows 8 and 10](https://stackoverflow.com/questions/27864040/fixing-npm-path-in-windows-8-and-10) – David R Aug 17 '18 at 06:37
-
please check your node version with this command in cmd: `node -v` & `npm -v` – dev-assassin Aug 17 '18 at 06:40
2 Answers
1
Aside from the solutions suggested in the links which are posted in the comments, you can also try the below command to update the PATH,
set PATH=%PATH%;C:\Users\YOUR_USER_NAME_OR_LOGIN\AppData\Roaming\npm;
Once executed, try re-running your ng serve
command again.
Hope this helps!

David R
- 14,711
- 7
- 54
- 72
0
Install Angular cli globally using this command.
$ npm install -g @angular/cli
the -g
switch installs angular cli(or any npm package globally on your system).

Majid Khoshnasib
- 28
- 6
-
C:\Users\snadarge>$ npm install -g @angular/cli '$' is not recognized as an internal or external command, operable program or batch file. ->I tried but not working – Suhas Nadarge Aug 21 '18 at 13:12
-
It seems you don’t have node and npm installed on your system. Follow instruction and install them first using below link: http://blog.teamtreehouse.com/install-node-js-npm-windows – Majid Khoshnasib Aug 21 '18 at 13:16
-
I have already installed it, problem is I am not able to use it CMD, but I can use it in nodeCommand – Suhas Nadarge Aug 21 '18 at 13:21
-
If you want to use the command in cmd you should add npm bin directory into your windows environment variables. I will put the link of how to do that – Majid Khoshnasib Aug 21 '18 at 13:25
-
https://www.taniarascia.com/how-to-install-and-use-node-js-and-npm-mac-and-windows/ – Majid Khoshnasib Aug 21 '18 at 16:38