尝试安装npm软件包,并获得EN0ENT错误的一切

这是运行npm install grunt-cli的示例输出

注意重复的node_modulespath? 这是一个环境path问题吗? 当我在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:我运行npmcaching清理并收到

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

我以前就打过这个,对我来说这个解决scheme就是运行

 npm cache clean 

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

更新:

如果失败了

 npm ERR! Error: EACCES, unlink ... 

那么这意味着npm进程无权删除该目录 。 你用sudo来运行任何npm install命令吗? 如果是这样可能值得运行

 sudo npm cache clean 

然后重新运行没有sudo的npm安装