【发布时间】:2019-03-30 06:51:58
【问题描述】:
在干净的 ubuntu 18.04 上安装 chrome headless 的整个过程中,我遇到了很多问题。 github 上的设置指南对于干净的 ubuntu 18.04 是不够的
以下是设置 headless chrome 替代 phantomjs 的一些错误和答案/解决方案。
错误 1
(node:23835) UnhandledPromiseRejectionWarning: Error: Chromium revision is not downloaded. Run "npm install" or "yarn install"
at Launcher.launch owlcommand.com /puppeteer/node_modules/puppeteer/lib/Launcher.js:112:15)
at <anonymous>
(node:23835) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:23835) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
错误 2
(node:25272) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
owlcommand.com /puppeteer/node_modules/puppeteer/.local-chromium/linux-594312/chrome-linux/chrome: error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory
【问题讨论】:
标签: puppeteer headless-browser google-chrome-headless