Mac npm与ENOENT错误

我是最近从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' } 

在上面的另一个消息包含:

 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 

在这里找出造成问题的任何帮助都是太棒了。 从我所知道的情况来看,其他模块也是如此。

npm cache clean

或者如果安装在su下

sudo npm cache clean

5个月前,grunt qunit软件包出现了一个问题 – https://github.com/gruntjs/grunt-lib-phantomjs/issues/5

尝试安装这个特定的包:

sudo npm install grunt-contrib-qunit

您安装的软件包是许多软件包的包。 qunit软件包的版本没有更新到这个软件包的最新版本,这就是为什么清除npmcaching可能会解决这个问题。