【发布时间】:2019-05-09 21:45:29
【问题描述】:
当我使用 Node 8 在 Cloud Functions 上运行 Puppeteer 时,出现此错误。
Error: Failed to launch chrome!
[1205/063825.588245:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
启动 Puppeteer 与
browser = await puppeteer.launch({
args: ['--no-sandbox'],
headless: true
})
解决了这个问题。 我在互联网上搜索过,找不到任何需要这样做的理由?
为什么 Headless Chrome 首先以 root 身份运行?
【问题讨论】:
标签: node.js firebase google-cloud-functions puppeteer google-chrome-headless