node.js - 由于 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()
这里可能出了什么问题?
解决方案
推荐阅读
- python - Azure Batch NodePreparationError 尝试从 Azure 容器注册表获取 Docker 映像
- powershell - Powershell:将变量存储到文件中
- flutter - 我在 dio 库中遇到了 Flutter 的问题 (dio: ^4.0.0)
- swagger-2.0 - swagger 2.0 中的对象数组
- html - 将引导范围滑块颜色更改为十六进制颜色?
- ios - os_log 在新 Xcode 13 的 Xcproject 旧版本中不起作用
- python - 删除 Matplotlib 绘图之间的水平空白
- variables - Compact-u16 - 这样做的目的是什么?
- python - 简单的时间序列线性回归
- excel - VBA For Loop - 如果行包含字符,则将某些输入添加到单元格?