首页 > 解决方案 > 由于 sanbox 问题,无法在 Heroku 上运行 Chromium/puppeteer

问题描述

这就是我开始pupetteer的方式node.js

const page = await puppeteer
    .launch({
      headless: true,
      slowMo: false,
      args: ["--no-sandbox", "--disable-setuid-sandbox"]
    })
    .then(browser => browser.newPage());

但我仍然收到以下错误

2018-11-27T05:21:26.673256+00:00 app[web.1]: (node:65) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
2018-11-27T05:21:26.673272+00:00 app[web.1]: [1127/052125.922709:FATAL:zygote_host_impl_linux.cc(116)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
2018-11-27T05:21:26.673275+00:00 app[web.1]: #0 0x55939710acac base::debug::StackTrace::StackTrace()

这里可能出了什么问题?

标签: node.jsherokupuppeteer

解决方案


推荐阅读