2013-03-06 126 views
11

我試圖通過npm在windows上安裝PhantomJS 1.8.1-3。無論我做什麼,它似乎都會失敗。下面是我運行命令:Windows安裝PhantomJS失敗

npm install phantomjs 

執行該命令後,它失敗,出現以下錯誤:

> [email protected] install c:\johnprojects\tablet\htdocs\mini-app-sandbox\node_ 
modules\grunt-contrib-qunit\node_modules\grunt-lib-phantomjs\node_modules\phanto 
mjs 
> node install.js 

Requesting c:\johnprojects\tablet\htdocs\mini-app-sandbox\node_modules\grunt-con 
trib-qunit\node_modules\grunt-lib-phantomjs\node_modules\phantomjs\tmp\phantomjs 
-1.8.1-windows.zip 

events.js:71 
     throw arguments[1]; // Unhandled 'error' event 
        ^
Error: connect ECONNREFUSED 
    at errnoException (net.js:770:11) 
    at Object.afterConnect [as oncomplete] (net.js:761:19) 
npm ERR! [email protected] install: `node install.js` 
npm ERR! `cmd "/c" "node install.js"` failed with 1 
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 Windows_NT 6.1.7601 
npm ERR! command "c:\\Program Files (x86)\\nodejs\\node.exe" "c:\\Program Files 
(x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "grunt-contrib-quni 
t" "--save-dev" 
npm ERR! cwd c:\johnprojects\tablet\htdocs\mini-app-sandbox 
npm ERR! node -v v0.8.21 
npm ERR! npm -v 1.1.32 
npm ERR! code ELIFECYCLE 
npm ERR! message [email protected] install: `node install.js` 
npm ERR! message `cmd "/c" "node install.js"` failed with 1 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  c:\johnprojects\tablet\htdocs\mini-app-sandbox\npm-debug.log 
npm ERR! not ok code 0 
+0

我與1.8.2有同樣的問題;下載zip文件並提取它告訴我phantomjs.exe的crc是無效的;這是我的npm日誌: https://gist.github.com/ToJans/5169008 – Tom 2013-03-15 10:52:31

+0

對於版本1.9.7-6,另一個可能的錯誤是'錯誤請求歸檔。狀態:403'。解決方法與@ashnazg的回答中所述的相同。 – Saul 2014-05-23 08:57:50

回答

1

phantomjs是尚未與節點兼容0.10。您需要0.08: https://github.com/yeoman/yeoman/issues/986

+0

即使在0.08時,這也不起作用 - 升級是我嘗試解決此問題的方法之一。 – user2140785 2013-03-18 19:17:26

+0

我花了一些努力纔得到0.08工作的良好安裝。我認爲首要的是確保任何問題與'brew doctor'解決.. – lambinator 2013-03-18 23:43:50

2

雖然我無法弄清楚爲什麼它發生,我能解決這ECONNREFUSED錯誤從phantomjs期間「故宮安裝」僅通過手動下載的zip文件壓縮文件的步驟分別將它放在下載試圖寫入的tmp目錄中。

+0

這是正確的答案。某種下載問題。謝謝! – 2014-03-21 13:45:15

0

我在安裝[email protected](html-snapshots =>相同的概率)時遇到了類似問題,其中[email protected]是依賴項。

雖然我沒有得到完全相同的錯誤。當你有

Error: connect ECONNREFUSED 

Error: EPERM, operation not permitted 

我的問題是這樣做的「BohemMedia」的評論,你可以在github固定權限問題HERE

其他方法並沒有爲我工作。

您的問題是拒絕連接。您是否嘗試關閉可能阻止連接的防火牆和其他安全程序?

+0

PS:[This](http://stackoverflow.com/questions/23823319/yeoman-generator-always-get-some-error?nah=1#28738433)文章也可能是有興趣的人誰有問題的幻影安裝 – 2015-02-26 09:21:36