簡體   English   中英

Mac npm出現ENOENT錯誤

[英]Mac npm erroring with 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軟件包的版本顯式更新為該捆綁包中的最新版本,這就是為什么清除npm緩存可以解決此問題的原因。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM