如何用npm安装PhantomJS v2 [英] How to install PhantomJS v2 with npm
问题描述
我尝试使用 npm
安装PhantomJS v2.0.0
,并尝试了几种方法后,没有找到工作解决方案......
I'm trying to install PhantomJS v2.0.0
using npm
and after trying a couple of methods I've not found a working solution...
在NPM上,最新版本是 1.9.16
,所以我'我在 package.json
中尝试了以下内容:
$ b
On NPM the latest version is 1.9.16
, so I've tried the following in my package.json
:
-
phantomjs:https://github.com/ariya/phantomjs/archive/2.0.0.tar.gz
"phantomjs": "https://github.com/ariya/phantomjs/archive/2.0.0.tar.gz"
这给了我一个错误,因为这个版本在github回购中没有 package.json
。
This gives me an error because there isn't a package.json
for this version in the github repo.
-
phantomjs:2.0.0
这个告诉我没有这个数字的版本。
This tells me there is no version with this number available.
我在这里错过了什么吗?
Am I missing something here?
推荐答案
phantomjs-prebuilt 已从 phantomjs 更名现在还包含版本2.1+的二进制文件。
phantomjs-prebuilt was renamed from phantomjs and now additionally contains binaries for version 2.1+.
npm -g install phantomjs-prebuilt
叉子 phantomjs2 仍然可用,其中包含版本2.0。
The fork phantomjs2 is still available which contains version 2.0.
npm -g install phantomjs2
请注意,并非所有平台都可能受支持。
Keep in mind that not all platforms might be supported.
这篇关于如何用npm安装PhantomJS v2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!