2014-02-12 58 views
2

这是从故宫运行输出例如安装咕噜-CLI尝试安装NPM包,让EN0ENT错误的一切

通知node_modules路径的重复?这是一个环境路径问题吗?当我在OSX上的其他用户上尝试相同的命令时,它可以按预期完美工作。

运行最新的OSX 10.9.1

npm http 304 https://registry.npmjs.org/weak 
npm http 304 https://registry.npmjs.org/bunker 
npm http 304 https://registry.npmjs.org/argparse 
npm http 200 https://registry.npmjs.org/mocha/-/mocha-0.3.3.tgz 
npm http 200 https://registry.npmjs.org/should/-/should-0.3.2.tgz 
npm http GET https://registry.npmjs.org/tiny-lr/0.0.4 
npm http GET https://registry.npmjs.org/cli/0.4.3 
npm http GET https://registry.npmjs.org/jasmine-node 
npm ERR! Error: ENOENT, lstat '/Users/shanejordan/Documents/Projects/KiddoMath/code/node_modules/grunt-cli/node_modules/resolve/node_modules/tap/node_modules/difflet/node_modules/traverse/index.js' 
npm ERR! If you need help, you may report this *entire* log, 
npm ERR! including the npm and node versions, at: 
npm ERR!  <http://github.com/isaacs/npm/issues> 

npm ERR! System Darwin 13.0.0 
npm ERR! command "node" "/usr/local/bin/npm" "install" "grunt-cli" 
npm ERR! cwd /Users/shanejordan/Documents/Projects/KiddoMath/code 
npm ERR! node -v v0.10.25 
npm ERR! npm -v 1.3.24 
npm ERR! path /Users/shanejordan/Documents/Projects/KiddoMath/code/node_modules/grunt-cli/node_modules/resolve/node_modules/tap/node_modules/difflet/node_modules/traverse/index.js 

UPDADE: 我跑NPM缓存清理并获得

npm ERR! Error: EACCES, unlink '/Users/shanejordan/.npm/_git-remotes/git-github-com-jkroso-forEach-f0435201/bra‌​nches' That must be my room problem. 
+0

虽然我不知道你的问题的具体原因,重复'node_modules'是由于依赖关系,以及依赖关系的依赖关系等等。 – hexacyanide

+0

Gotcha。也许它不是那么回事。我无法弄清楚为什么ENOENT会一直发生。它看起来像开始工作,然后它会像这样运行5分钟...看起来像它抓住每个依赖于npm,以及这些类型的错误。无论我尝试安装什么软件包,并安装 – Shane

+0

您是否尝试过查找'ENOENT'错误引发的路径? – hexacyanide

回答

3

我打过去这一点,这对我的解决办法工作是运行

npm cache clean 

然后再次尝试重新运行npm install命令。

更新:

如果它失败

npm ERR! Error: EACCES, unlink ... 

那么这意味着该过程NPM doesn't have access to remove that directory。您是否使用sudo来运行任何npm安装命令?如果是的话它可能是值得运行

sudo npm cache clean 

,然后重新运行安装NPM不sudo

+0

我运行* npm cache clean *并收到npm ERR!错误:EACCES,取消链接'/Users/shanejordan/.npm/_git-remotes/git-github-com-jkroso-forEach-f0435201/branches'这一定是我的房间问题。 – Shane

+0

我已经尝试清除缓存,但它仍然无法正常工作,它会引发错误“%E2%80%93g”不在npm注册表中 npm ERR!404您应该错误地将作者发布为“ – Max

+0

这是为我工作的解决方案。 FWIW,我在安装没有使用sudo的发电机时遇到了一些严重的问题,并发现使用sudo安装它们会导致其他问题。我卸载了npm,然后使用nvm(节点版本管理器 - 很好的工具)重新安装它,这几乎可以确保您再也不必使用sudo(以及许多其他不错的功能)。我确实不得不使用sudo来清理npm缓存,但是之后所有工作都按预期工作。 –