banquo / phantom nodejs错误 - 无法读取属性' createPage'未定义的

时间:2015-06-24 10:27:19

标签: node.js phantomjs

我试图运行https://github.com/ajam/banquo-server并收到错误

  

无法阅读属性' createPage'未定义的

Express server listening on port 3000
Requesting http://america.aljazeera.com
/root/banquo-server/node_modules/banquo/src/banquo.js:36
    ph.createPage(openPage);
      ^
TypeError: Cannot read property 'createPage' of undefined
    at createPage (/root/banquo-server/node_modules/banquo/src/banquo.js:36:7)
    at /root/banquo-server/node_modules/node-phantom/node-phantom.js:65:6
    at null._onTimeout (/root/banquo-server/node_modules/node-phantom/node-phantom.js:43:5)
    at Timer.listOnTimeout (timers.js:110:15)
error: Forever detected script exited with code: 1
error: Script restart attempt #7
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0

我已经检查过并且从node-phantom.js返回了一个错误:36但没有指定。

任何想法?

问候

1 个答案:

答案 0 :(得分:2)

我遇到了同样的问题并修复了将 phantomjs 二进制文件添加到PATH的问题。

您可以测试是否已经设置了运行命令:

timespec_add_ns()

以下错误表示它不是:

  

' phantomjs'不被识别为内部或外部命令,可操作程序或批处理文件

正如你在comment中所说的那样:

  

不是错误,因为这适用于我的本地mac,而不是外部服务器

所以,这对您的代码来说不是问题。这对你的环境来说是一个问题,所以我猜你也错过了设置PATH变量。