2013-03-06 125 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