我试图通过npm在Windows上安装PhantomJS 1.8.1-3。无论我做什么,它似乎都会失败。这是我正在运行的命令:
npm install phantomjs
执行该命令后,它失败并出现以下错误:
> 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
答案 0 :(得分:2)
虽然我无法弄清为什么它正在发生,但是我可以在phantomjs zip文件步骤中通过单独手动下载zip文件解决来自“npm install”的ECONNREFUSED错误,将它放在下载尝试写入的tmp目录中。
答案 1 :(得分:1)
phantomjs尚未与节点0.10兼容。你需要0.08: https://github.com/yeoman/yeoman/issues/986
答案 2 :(得分:0)
我在安装grunt-html-snapshot@0.6.1(html-snapshots =>相同概率)时遇到了一个类似的问题,其中phantomjs@1.9.15是一个依赖。
虽然我没有得到完全相同的错误。你在哪里
Error: connect ECONNREFUSED
我得到了
Error: EPERM, operation not permitted
我的问题是修复了一个权限问题,你可以在github上找到“BohemMedia”评论HERE
其他方法对我不起作用。
您的问题是拒绝连接。您是否尝试关闭可能阻止连接的防火墙和其他安全程序?