【问题标题】:Windows Install of PhantomJS failsPhantomJS 的 Windows 安装失败
【发布时间】:2013-02-21 15:58:17
【问题描述】:

我正在尝试通过 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

【问题讨论】:

  • 我对 1.8.2 也有同样的问题;下载 zip 并解压缩它告诉我 phantomjs.exe 的 crc 无效;这是我的 npm 日志:gist.github.com/ToJans/5169008
  • 对于 1.9.7-6 版本,另一个可能的错误是 Error requesting archive. Status: 403。解决方法与@ashnazg 的答案中描述的相同。

标签: windows windows-7 gruntjs npm phantomjs


【解决方案1】:

虽然我无法弄清楚 为什么会发生这种情况,但我能够在 phantomjs zip 文件步骤中解决来自“npm install”的 ECONNREFUSED 错误,只需单独手动下载 zip 文件,将其放在下载尝试写入的 tmp 目录中。

【讨论】:

  • 这是正确的答案。某种下载问题。谢谢!
【解决方案2】:

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

【讨论】:

  • 即使在我使用 0.08 时,这也不起作用 - 升级是我尝试解决此问题的方法之一。
  • 我花了一些力气才能很好地安装 0.08。我认为首要的是确保brew doctor 的任何问题都得到解决..
【解决方案3】:

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

虽然我没有得到完全相同的错误。你从哪里来的

Error: connect ECONNREFUSED

我明白了

Error: EPERM, operation not permitted

我的问题是在 github HERE 上发表“BohemMedia”评论时修复了权限问题

其他方法对我不起作用。

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

【讨论】:

  • P.S.:This 的帖子也可能对 phantomjs 安装有问题的人感兴趣
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-06-15
相关资源
最近更新 更多