【问题标题】:Install a specific version of angular-cli [closed]安装特定版本的 angular-cli [关闭]
【发布时间】:2024-05-21 15:10:02
【问题描述】:

我将笔记本电脑从 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

节点版本:7.9.0

NPM 版本:4.2.0

【问题讨论】:

标签: node.js npm angular-cli


【解决方案1】:

经过一番调查,这实际上是一个愚蠢的错误。尽管如此,将其作为上面提供的错误消息共享一点都不清楚。

原来4.1.0版本没有angular-cli。

使用正确的版本重新运行如下诀窍:

npm install -g @angular/cli@1.2.4

【讨论】: