Mac npm与ENOENT错误

Dav*_*vid 7 macos node.js npm gruntjs

我是最近从Windows转换到Mac的,目前只是尝试设置我的工具.

我首先使用自制软件安装节点,这给了我错误(与我现有的相同).我后来使用自制程序删除了节点,并使用节点网站上的pkg进行安装.

我可以在命令行和npm中访问节点.问题是当我尝试在本地项目上安装模块时,我会得到类似的结果:

npm install grunt-contrib

Error extracting archive { [Error: ENOENT, open '/Users/davidmckeown/dev/adt-com/node_modules/grunt-contrib/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/tmp/phantomjs-1.7.0-macosx.zip']
  errno: 34,
  code: 'ENOENT',
  path: '/Users/davidmckeown/dev/adt-com/node_modules/grunt-contrib/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/tmp/phantomjs-1.7.0-macosx.zip' }
Run Code Online (Sandbox Code Playgroud)

上面的另一条消息包含:

npm ERR! phantomjs@0.2.6 install: `node install.js`
npm ERR! `sh "-c" "node install.js"` failed with 8
npm ERR!
npm ERR! Failed at the phantomjs@0.2.6 install script.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls phantomjs
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 12.2.1
npm ERR! command "node" "/usr/local/bin/npm" "install" "grunt-contrib"
npm ERR! cwd /Users/davidmckeown/dev/adt-com
npm ERR! node -v v0.10.0
npm ERR! npm -v 1.2.14
npm ERR! code ELIFECYCLE
Run Code Online (Sandbox Code Playgroud)

任何帮助搞清楚造成问题的原因都会很棒.从我所知道的,其他模块也会发生这种情况.

Rom*_*rov 27

npm cache clean

或者如果安装在su下

sudo npm cache clean