windows - 在 Windows 上使用 NPM 安装 PhantomJS 2 失败

标签 windows npm phantomjs

我正在尝试为需要支持变异观察器的项目安装 PhantomJS 2。当我使用以下命令时:

npm install phantomjs2 --save-dev

我收到以下错误:

Unexpected platform or architecture: win32 x64
npm ERR! phantomjs2@2.0.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs2@2.0.0 install script.
npm ERR! This is most likely a problem with the phantomjs2 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 phantomjs2
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodej
s\\node_modules\\npm\\bin\\npm-cli.js" "install" "phantomjs2" "--save-dev"
npm ERR! cwd g:\Web\GitHub\pet
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     g:\Web\GitHub\pet\npm-debug.log
npm ERR! not ok code 0

我使用的是 64 位 Windows 7。我的平台是否不支持 PhantomJS 2?

最佳答案

是的,该软件包目前不支持在 Windows 上安装 PhantomJS 2。只需从 official page 下载即可并将 exe 放在 PATH 中的目录中。

关于windows - 在 Windows 上使用 NPM 安装 PhantomJS 2 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29736134/

相关文章:

java - 如何让 Java 应用程序在 PC 启动时自动启动?

node.js - 只要至少有两个应用程序正在使用某个模块,我就应该全局安装该模块吗?

c# - 如何使用 Phantomjs、selenium 和 c# 连接到 Tor 网络

javascript - SystemJS + Karma + TypeScript - 未运行测试

PhantomJS:在任何其他脚本运行之前注入(inject)脚本

c - 在c中的进程间同步中互斥体的使用

c# - 从十六进制数获取 Windows 系统错误代码标题/描述

c++ - 32/64 位 Windows/Linux 应用程序

node.js - npm install 不在 GitHub 上安装最新版本

linux - Node.js - 找不到已安装模块的命令