ng build
时,我遇到了这个错误:PS D:\Dashboard\Test1> ng build
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 build
+ ~~
+ CategoryInfo : ObjectNotFound: (ng:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我已经将这些环境变量添加到 Path
中:
我已经将这些环境变量添加到 Path
中:
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;
C:\Users\Avind\AppData\Local\Programs\Microsoft VS Code\bin;
C:\Users\Avind\AppData\Roaming\npm;
我该如何解决这个问题?
注意:我的电脑中有 node.js
,安装在 C:\Program Files\nodejs
。从命令提示符中输入 ng new project
没有反应,但从 node.js
命令中可以执行成功。
在 Visual Studio Code 终端中执行 npm install -g @angular/cli@latest
后,我收到以下消息,并且 ng
命令无法使用:
PS D:\Path\Test1> npm install -g @angular/cli@latest
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
C:\Users\Avind\AppData\Roaming\npm\ng -> C:\Users\Avind\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng
> @angular/cli@9.1.9 postinstall C:\Users\AR20095474\AppData\Roaming\npm\node_modules\@angular\cli
> node ./bin/postinstall/script.js
+ @angular/cli@9.1.9
updated 1 package in 53.477s
npm config get bin-links
命令,它会返回什么? - kaitrue
。 - R15C:\Users\Avind\AppData\Roaming\npm
文件夹内是否有一个名为ng.cmd
的文件? - kai