【发布时间】:2021-11-26 14:47:20
【问题描述】:
我不熟悉使用 Angular 或 Visual Studio 代码。我安装了运行良好的 node.js 和 npm。运行项目的命令ng serve,在命令提示符下完美运行。但是,当我切换到 vs 代码的终端区域并运行相同的命令 ng serve 时,它会抛出如下错误。
ng : The term 'ng' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:1
+ ng serve
+ ~~
+ CategoryInfo : ObjectNotFound: (ng:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
再一次,如果我使用npm run ng serve,它的工作方式就像它在 vs code 终端中的工作方式一样。
它是如何工作的?如果没有,我应该怎么做才能使用ng serve 运行项目?
【问题讨论】:
标签: node.js npm visual-studio-code angular-cli