无法安装包含NPM的软件包...卡在[email protected]

问题描述:

我正在尝试使用npm安装@angular/cli。但它总是卡住在下载包chokidar无法安装包含NPM的软件包...卡在[email protected]

enter image description here

诊断信息:

npm version 5.0.0 
node version 8.0.0 
Operating System Windows 7 
+0

你等了多久才能完成。有时它只是需要更多的时间 –

+0

尝试做npm缓存清理 –

+0

我等了10个多小时。我清理了我的系统并重新安装了节点,但结果相同。 – user3146692

我自己解决这个问题。我在导致问题的环境变量(系统)中有多个临时变量。

我通过使用管理员权限运行命令提示符解决了此问题,并且其工作正常。看看附带的图像。

https://i.stack.imgur.com/IXsfz.png

请升级您的nodenpm版本最新。之后,请按照以下步骤安装angular/cli

1)使用管理权限打开您的命令提示符并使用npm uninstall -g angular-cli命令卸载angular/cli

2)您可以尝试从您的项目目录中删除node_modules,然后使用npm cache clear --force命令清除缓存。 3)删除C:\Users\<username>\AppData\Roaming\npm\C:\Users\<username>\AppData\Roaming\npm-cache

4)尝试使用npm install -g @angular/[email protected]命令安装angular/[email protected]