2013-03-18 138 views
7

我最近從Windows轉換到Mac,目前只是試圖讓我的工具設置。Mac npm錯誤與ENOENT

我第一次安裝使用自制軟件的節點,這給了我錯誤(和我現在一樣)。我後來使用自制軟件刪除節點,並使用節點網站中的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! [email protected] install: `node install.js` 
npm ERR! `sh "-c" "node install.js"` failed with 8 
npm ERR! 
npm ERR! Failed at the [email protected] 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 

任何幫助搞清楚什麼是在這裏造成問題將是太棒了。從我所知道的情況來看,這也會發生在其他模塊上。

+4

聽起來像它可能是一個NPM緩存問題,請嘗試'NPM緩存clean' – generalhenry 2013-03-18 17:13:26

+0

@generalhenry可惜不是,試過和sudo'ing npm安裝但沒有喜悅。 – David 2013-03-18 17:19:14

+0

您是否檢查過npm是否試圖解壓zip文件? – travis 2013-03-18 17:57:22

回答

27

npm cache clean

,或者如果蘇下安裝

sudo npm cache clean

+1

有工作對我有同樣的問題。 – 2013-09-02 18:16:26

+1

沒有對我有用。 – prayagupd 2014-05-26 17:45:35

+0

也適用於我。 – 2015-01-26 17:35:59

1

5個月前有一個問題與grunt qunit包 - https://github.com/gruntjs/grunt-lib-phantomjs/issues/5

嘗試安裝這個特定的軟件包:

sudo npm install grunt-contrib-qunit

您所安裝的包是許多包的包。 qunit軟件包版本並未明確更新到此軟件包中的最新版本,因此清除npm緩存可能會解決此問題。