在Mac(Yosemite)上以phantomjs#2.0.0运行casperjs的问题 [英] Issues running casperjs with phantomjs#2.0.0 on Mac (Yosemite)

查看:58
本文介绍了在Mac(Yosemite)上以phantomjs#2.0.0运行casperjs的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Mac(Yosemite)上运行具有 PhantomJS#2.0.0 CasperJS .尝试运行 CasperJS 时,我收到以下消息:

I'm trying to run CasperJS having PhantomJS#2.0.0 on a Mac(Yosemite). When trying to run CasperJS I´m getting the following message:

"CasperJS needs PhantomJS v1.x

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

如何使其运行?有人有工作吗?

How can I make it run? Has anyone got it working?

推荐答案

当前没有比1.1-beta3更高的版本包含此检查.

Currently there is no newer version than 1.1-beta3 released which contains this check.

最简单的解决方法是打开bin/bootstrap.js文件并中的行主分支:

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 master branch:

(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安装CasperJS..

这篇关于在Mac(Yosemite)上以phantomjs#2.0.0运行casperjs的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆