11

I am attempting to install PhantomJS 1.8.1-3 on windows via npm. It appears to fail regardless of what I do. Here's the command I am running:

npm install phantomjs

After executing that command, it fails with the following errors:

    > phantomjs@1.8.1-3 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! phantomjs@1.8.1-3 install: `node install.js`
npm ERR! `cmd "/c" "node install.js"` failed with 1
npm ERR!
npm ERR! Failed at the phantomjs@1.8.1-3 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 phantomjs@1.8.1-3 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
4

3 回答 3

2

虽然我不知道为什么会发生这种情况,但我可以在 phantomjs zip 文件步骤中解决来自“npm install”的 ECONNREFUSED 错误,只需手动单独下载 zip 文件,将其放在下载所在的 tmp 目录中试图写入。

于 2013-09-25T21:41:54.907 回答
1

phantomjs 还不兼容节点 0.10。你需要 0.08: https ://github.com/yeoman/yeoman/issues/986

于 2013-03-18T16:53:06.303 回答
0

我在安装 grunt-html-snapshot@0.6.1 (html-snapshots => same prob) 时遇到了一个类似的问题,其中 phantomjs@1.9.15 是一个依赖项。

我没有得到完全相同的错误。你在哪里

Error: connect ECONNREFUSED

我有

Error: EPERM, operation not permitted

我的问题是修复了权限问题,您可以在 github HERE上找到“BohemMedia”评论

其他方法对我不起作用。

您的问题是连接被拒绝。您是否尝试关闭防火墙和其他可能阻止连接的安全程序?

于 2015-02-12T10:53:17.273 回答