做错误" npm -g update"用homebrew安装新节点之后

时间:2014-04-03 13:37:11

标签: node.js npm homebrew

我正在通过自制程序进行新节点安装,并且没有安装任何其他模块。 如果我进行全局更新     npm -g更新 我得到了下面显示的所有错误。 什么错了?

$ npm -g update
npm http GET https://registry.npmjs.org/npm
npm http 304 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/1.4.6
npm http 304 https://registry.npmjs.org/npm/1.4.6
npm ERR! error rolling back Error: Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm
npm ERR! error rolling back     at clobberFail (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/utils/gently-rm.js:57:12)
npm ERR! error rolling back     at next (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/utils/gently-rm.js:43:14)
npm ERR! error rolling back     at /usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/utils/gently-rm.js:52:12
npm ERR! error rolling back     at Object.oncomplete (fs.js:107:15)
npm ERR! error rolling back  npm@1.4.6 { [Error: Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm] code: 'EEXIST', path:     '/usr/local/bin/npm' }
npm ERR! Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm
File exists: /usr/local/bin/npm
Move it away, and try again. 

npm ERR! System Darwin 13.1.0
npm ERR! command "/usr/local/Cellar/node/0.10.26/bin/node" "/usr/local/bin/npm" "-g" "update"
npm ERR! cwd /usr/local
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /usr/local/bin/npm
npm ERR! code EEXIST
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /usr/local/npm-debug.log
npm ERR! not ok code 0

1 个答案:

答案 0 :(得分:1)

好吧,不确定它是否对您有所帮助,但github上存在问题:https://github.com/Homebrew/homebrew/issues/22408

许多人建议从官方下载node.js,而不是使用Homebrew。选择当然是你的。