木偶无法在Heroku上运行 [英] Puppeteer unable to run on heroku

查看:91
本文介绍了木偶无法在Heroku上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在heroku上部署了一个应用程序,并添加了伪造的Heroku buildpack.

I deployed an app on heroku, and i added the puppeteer Heroku buildpack.

成功重新部署后,我尝试运行它,但失败.使用heroku logs -t,我收到此错误消息:

After a succesful redeployment, i try to run it and it fails. Using heroku logs -t, i get this error message:

2018-09-07T13:16:10.870497+00:00 app[web.1]: Error: Failed to launch chrome!
2018-09-07T13:16:10.870512+00:00 app[web.1]: [0907/131610.045486:FATAL:zygote_ho
st_impl_linux.cc(116)] No usable sandbox! Update your kernel or see https://chro
mium.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.

推荐答案

您应该可以通过传递 --disable-setuid-sandbox 标记为 puppeteer.launch() :

You should be able to solve this issue by passing the --no-sandbox and --disable-setuid-sandbox flags to puppeteer.launch():

const browser = await puppeteer.launch({
  args: [
    '--no-sandbox',
    '--disable-setuid-sandbox',
  ],
});

如果这不起作用,您可能需要阅读官方的Puppeteer故障排除指南:

If this does not work, you may want to read the official Puppeteer troubleshooting guide: Running Puppeteer on Heroku.

这篇关于木偶无法在Heroku上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆