由于节点模块错误,傀儡师失败



我是木偶师的新手,希望得到尽可能多的帮助。 我的木偶测试构建在特拉维斯 ci 中失败。我假设原因可能与木偶师的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

节点.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.

来自 Puppeteer 文档:

Puppeteer 至少需要 Node v6.4.0,但下面的示例使用 async/await,这仅在 Node v7.6.0 或更高版本中受支持。

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

您可以参考有关指定节点.js版本的 Travis 文档。这是一个最小的设置:

.travis.yml

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

最新更新