【发布时间】:2014-03-11 14:31:01
【问题描述】:
这是运行 npm install grunt-cli 的示例输出
注意到 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
更新: 我运行 npm cache clean 并收到了
npm ERR! Error: EACCES, unlink '/Users/shanejordan/.npm/_git-remotes/git-github-com-jkroso-forEach-f0435201/branches' That must be my room problem.
【问题讨论】:
-
虽然我不知道你的问题的具体原因,但是重复的
node_modules是由于依赖,依赖的依赖等等。 -
明白了。也许那时不是这样。我不明白为什么 ENOENT 一直在发生。看起来它开始工作了,然后它将像这样运行 5 分钟......看起来它抓住了对 npm 的每个依赖项,以及这些类型的错误。无论我尝试安装什么软件包
-
您是否尝试过查看引发
ENOENT错误的路径? -
npm 安装在哪个用户下?也许 node/npm setup 已经为安装它的人设置了 env,而不是为所有用户设置?
-
我只有一个用户。我创建了另一个只是为了测试它是否与我的特定用户环境有关。好像是这样。我之前确实用 sudo 安装了一些 npm 包,后来我知道这是不行的。