我有最新版本的node和npm:
> npm -v
3.10.8
> node -v
v4.6.1
时获取此信息
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Misha\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "angular-cli"
npm ERR! node v4.6.1
npm ERR! npm v3.10.8
npm ERR! path C:\Users\Misha\AppData\Roaming\npm\node_modules\.staging\abbrev-9f02c1d4
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Mishap\AppData\Roaming\npm\node_modules\.staging\abbrev-9f02c1d4' -> 'C:\Users\Mishap\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\abbrev'
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Mishap\AppData\Roaming\npm\node_modules\.staging\abbrev-9f02c1d4' -> 'C:\Users\Mishap\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\node_modules\abbrev'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
有什么想法吗?
答案 0 :(得分:4)
卸载软件包首先解决了问题:
npm uninstall -g angular-cli
npm install -g angular-cli
答案 1 :(得分:1)
更新您的节点,然后以管理员身份运行命令提示符并尝试:
npm install -g angular-cli@1.0.0-beta.18
答案 2 :(得分:0)
我已经按照以下步骤解决了这些错误。
如果您已经安装了某些@ angular / cli,请通过以下方式将其卸载
npm卸载-g angular-cli
将npm缓存清理为
npm缓存清理
然后尝试安装为
npm install -g @ angular / cli @ latest