PhatomJS:如何在phatom js中使用(require)一个npm模块?

时间:2016-06-02 14:28:37

标签: node.js module npm phantomjs runtime-error

我正在尝试require()并在phatomJS中使用此logging module(它也有一些依赖项),但它失败并打印出此错误:

C:\node\scrap>phantomjs app.js
ReferenceError: Can't find variable: process

  phantomjs://platform/index.js:3
ReferenceError: Can't find variable: process

  phantomjs://platform/index.js:9
TypeError: undefined is not an object (evaluating 'chalk.bold.red')

  phantomjs://platform/index.js:29
TypeError: undefined is not a constructor (evaluating 'log.info('All settings loaded, start with exe
cution')')

  phantomjs://code/app.js:16 in global code

我不知道为什么或出了什么问题?我错过了什么?

0 个答案:

没有答案