1

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

Suhas Nadarge
  • 11
  • 1
  • 3

2 Answers2

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).

  • 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