由于节点模块错误,拼写失败

时间:2018-10-04 16:02:51

标签: node.js typescript puppeteer

我是puppeteer的新手,希望能获得尽可能多的帮助。 我的操纵up测试构建在travis ci中失败。我假设原因可能与操纵up的node_module有关。任何建议都会有所帮助。 记录了类似的问题,但未提供解决方案。以下是这些问题的一些链接:

https://github.com/GoogleChrome/puppeteer/issues/833

https://api.travis-ci.com/v3/job/124937719/log.txt

https://travis-ci.com/BME-MIT-IET/Hmmm-iet-2018/jobs/124938746

我的系统配置:

木偶版本:1.8.0

平台/操作系统版本:Mac> High Sierra

Node.js版本:v8.12.0

npm:6.4.1

这是错误消息:

puppeteer@1.8.0 install /www/vhosts//node_modules/puppeteer
node install.js
/www/vhosts/node_modules/puppeteer/install.js:61
.then(() => browserFetcher.localRevisions())
^
SyntaxError: Unexpected token )
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:935:3
npm ERR! puppeteer@1.8.0 install: node install.js
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the puppeteer@1.8.0 install script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the puppeteer package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs puppeteer
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls puppeteer
npm ERR! There is likely additional logging output above.

1 个答案:

答案 0 :(得分:0)

从the documentation起:

  

Puppeteer至少需要Node v6.4.0,但是下面的示例使用async / await,只有Node v7.6.0或更高版本才支持。

您的Travis配置使用节点v0.10.42,因此必须将其升级到至少v6.4.0。

您可以参考Specifying Node.js versions上的Travis文档。这是一个最小的设置:

.travis.yml

language: node_js
node_js:
  - "iojs"
  - "7"