在Mac(优胜美地)上使用Phantomjs#2.0.0运行Casperjs的问题[英] Issues running casperjs with phantomjs#2.0.0 on Mac (Yosemite)

问题描述

我试图在 phantomjs#2.0.0 上运行 casperjs 在 Mac(Yosemite)上.当尝试运行 casperjs 时,我会收到以下消息:

"CasperJS needs PhantomJS v1.x

  /usr/local/Cellar/casperjs/1.1-beta3/libexec/bin/bootstrap.js:91 in __die"

我该如何运行?有人有效吗?

推荐答案

当前没有比1.1-beta3发布的新版本,该版本包含此检查.

The simplest fix would be to open the bin/bootstrap.js file and remove these lines or replacing the lines that are currently in the 主分支:

(function (version) {
    // required version check
    if (version.major === 1) {
        if (version.minor < 8) {
            return __die('CasperJS needs at least PhantomJS v1.8 or later.');
        }
        if (version.minor === 8 && version.patch < 1) {
            return __die('CasperJS needs at least PhantomJS v1.8.1 or later.');
        }
    } else if (version.major === 2) {
        console.log("Warning PhantomJS v2.0 not yet released. There will not be any official support for any bugs until stable version is released!");
    }
    else return __die('CasperJS needs PhantomJS v1.x or v2.x');
})(phantom.version);

另一个选项是 git .

其他推荐答案

修改/usr/local/cellar/casperjs/1.1-beta3/libexec/bin/bootstrap.js对我不起作用.我尝试了,但仍然存在一些其他问题(无法正确获得CasperPath和版本).

此问题已经在主分支中解决.从Git安装将解决此问题.

尝试

> git clone git://github.com/n1k0/casperjs.git
> cd casperjs
> ln -sf `pwd`/bin/casperjs /usr/local/bin/casperjs

它完美地修复了我的casperj.

其他推荐答案

我遇到了同样的问题.用1.9.8的版本替换在/usr/local/bin中可执行的phantomjs.

本文地址:https://www.itbaoku.cn/post/1739881.html