简体   繁体   中英

npm' is not recognized as an internal or external command, operable program or batch file in visual studio

在此处输入图像描述我无法使用ng serve在 Visual Studio 中构建 angular 项目,但我可以使用node.js 命令提示符来完成,请给我解决方案

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM