Windows 安装 PhantomJS 失败

标签 windows windows-7 gruntjs npm phantomjs

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

最佳答案

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

关于Windows 安装 PhantomJS 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15254488/

相关文章:

windows - 我怎样才能让 Perl 6 在 Windows 上运行?

mysql - 无法连接到现有 MySQL 数据库

delphi - 如何获取文件夹的权限级别?

visual-studio - Visual Studio 2015 预览版 - Grunt 和 Bower 集成

node.js - 如何使用 grunt-sass-replace 替换 sass 变量值?

c++ - 如何获得由 gcc-mingw 编译的进程的最大内存使用量

python - 如何让 Spyder 直接从 Windows 资源管理器打开 python 脚本(.py 文件)

Delphi Windows 7 控制面板组件

python - 在多个目录中按名称搜索文件?

node.js - Grunt - 在开发中编译并导入单独的 sass,但在构建时将它们连接起来