npm -g list command I can see installed Angular globally but when I run the ng --version it is giving
this error 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 --version
+ ~~
+ CategoryInfo : ObjectNotFound: (ng:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我已经从我的pc上删除了node和npm,并重新安装了它们,但它仍然不工作。
2条答案
按热度按时间neekobn81#
我认为你需要检查npm软件包的版本。你输入的内容意味着你要求它通过运行angular installed程序来检查版本,而不是npm软件包。你需要的命令是
npm list ng --depth=0
。这会给你npm安装的版本。它会把它从你使用的list命令中去掉。https://nodejs.dev/learn/find-the-installed-version-of-an-npm-package
如果您希望能够从命令行使用angular,则还需要安装angular-cli。
gupuwyp22#
首先:通过编写-〉〉〉来安装CLI:npm install-g@angular/cli第二个:如果你想检查你的版本,写--〉〉〉:* * 一月一日**