[英]npm install -g @angular/cli not working and hanging in windows 7
I am unable to install the angular cli from the npm and its getting stuck asking to loadAllDepsIntoIdealTree. 我无法从npm安装角度cli及其卡住,要求加载loadAllDepsIntoIdealTree。
Steps taken: 采取的步骤:
C:\\Windows\\system32\\node -v C:\\ Windows \\ system32 \\ node -v
v6.11.1 v6.11.1
C:\\Windows\\system32\\npm -v C:\\ Windows \\ system32 \\ npm -v
3.10.10 3.10.10
C:\\Windows\\system32\\npm install -g @angular/cli C:\\ Windows \\ system32 \\ npm安装-g @ angular / cli
Its gets stuck with the attached error 它被附加的错误卡住了
I also stucked in the same problem. 我也陷入了同样的问题。 Below solution works for me.
下面的解决方案为我工作。
It would be better if you upgrade your node
and npm
versions to latest. 如果将
node
和npm
版本升级到最新版本会更好。 After that please follow the below steps to install the angular/cli
: 之后,请按照以下步骤安装
angular/cli
:
Open your command prompt with administrative privileges and uninstall angular/cli
by using npm uninstall -g angular-cli
command. 使用管理特权打开命令提示符,然后使用
npm uninstall -g angular-cli
命令卸载angular/cli
。
Remove node_modules
directory and then clear the cache by using npm cache clear --force
command. 删除
node_modules
目录,然后使用npm cache clear --force
命令npm cache clear --force
。
Remove C:\\Users\\<username>\\AppData\\Roaming\\npm\\
and C:\\Users\\<username>\\AppData\\Roaming\\npm-cache
. 删除
C:\\Users\\<username>\\AppData\\Roaming\\npm\\
和C:\\Users\\<username>\\AppData\\Roaming\\npm-cache
。
Try to install the angular/cli@latest
by using npm install -g @angular/cli@latest
command. 尝试安装
angular/cli@latest
通过npm install -g @angular/cli@latest
命令。
Hope the above trick resolve your issue. 希望以上技巧能解决您的问题。
I had the same problem for npm@5.3.0
on macOS
. 我在
macOS
npm@5.3.0
遇到了同样的问题。 It was resolved by checking my package.json
file with validator . 通过使用validator检查我的
package.json
文件来解决此问题。
In my case the problem was the git package version notation: gulpjs/gulp.git#4.0
instead of https://github.com/gulpjs/gulp.git#4.0
. 就我而言,问题是git软件包的版本符号:
gulpjs/gulp.git#4.0
而不是https://github.com/gulpjs/gulp.git#4.0
。
After changes I also regenerate package-lock.json
. 更改之后,我还重新生成
package-lock.json
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.