npm在Windows 7上安装“添加caching目录”错误

在将Node.js更新为0.10.23 ,在尝试安装grunt时出现错误: npm install -g grunt-cli

系统:Win7 x64。 节点版本:0.10.23,npm版本:1.3.17

 66 silly lockFile d63f3d0b-grunt-cli grunt-cli@ 67 error Error: Adding a cache directory to the cache will make the world implode. 67 error at addLocalDirectory (c:\nodejs\node_modules\npm\lib\cache.js:1120:45) 67 error at c:\nodejs\node_modules\npm\lib\cache.js:1173:7 67 error at cb (c:\nodejs\node_modules\npm\lib\utils\tar.js:150:7) 67 error at c:\nodejs\node_modules\npm\lib\utils\tar.js:147:9 67 error at c:\nodejs\node_modules\npm\node_modules\lockfile\lockfile.js:61:41 67 error at Object.oncomplete (fs.js:107:15) 68 error If you need help, you may report this *entire* log, 68 error including the npm and node versions, at: 68 error <http://github.com/isaacs/npm/issues> 69 error System Windows_NT 6.1.7601 70 error command "c:\\nodejs\\node.exe" "c:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "grunt-cli" 71 error cwd z:\home\minpik.lc\www 72 error node -v v0.10.23 73 error npm -v 1.3.17 74 verbose exit [ 1, true ] 

Thx,全部。 看起来像node.js 0.10.23 buged的东西。 我已经完全删除了最新版本,并安装了0.8.9,现在没关系。

我有完全相同的问题,它看起来只是版本0.10.23这就是问题所在。 我安装了0.10.22,一切正常。

在升级节点版本之前,您必须完全删除较早版本的节点。 如果要在不同版本的节点之间切换,请使用节点版本pipe理器

要使用nvm升级到节点版本0.10,

 nvm install 0.10 

要使用旧版本的节点(比如说0.8)

 nvm use 0.8 

我发现nvm真正有用的工具来切换不同的节点版本。 尝试一下!! NVM仅适用于Linux环境。

对于Windows ,您可以使用NVMW 。 看到这个博客有很好的帮助。