安装特定版本的angular-cli

3

我将我的笔记本电脑从Windows 7更改为Windows 10,但无法安装特定版本的Angular CLI。

我尝试了以下方法:

npm install -g @angular/cli@4.1.0

我也尝试了以下方法:

npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@4.1.0

我经常遇到以下问题:
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli@4.1.0"
npm ERR! node v7.9.0
npm ERR! npm  v4.2.0

npm ERR! Cannot read property 'path' of null
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     D:\Users\ihazan\AppData\Roaming\npm-cache\_logs\2017-11-16T13_04_39_665Z-debug.log

Node版本:7.9.0

NPM版本:4.2.0


你可以查看这个答案 https://dev59.com/mqjja4cB1Zd3GeqP6y11#52067532 它对我有用。 - Ferie
1个回答

4
经过一些调查,实际上这是一个愚蠢的错误。尽管如此,仍然分享出来,因为上面提供的错误信息根本不清楚。
事实证明,没有angular-cli的版本为4.1.0。
使用正确的版本重新运行如下命令即可解决问题:
npm install -g @angular/cli@1.2.4

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接