Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否增加个命令行参数,让chromium在无沙箱模式下运行? #28

Open
jmjoy opened this issue Apr 7, 2023 · 1 comment

Comments

@jmjoy
Copy link

jmjoy commented Apr 7, 2023

https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#setting-up-chrome-linux-sandbox

因为是在Docker里全局安装的(用root跑的),所以得在root用户下运行,能够无沙箱运行就不会报错了。

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

问题: 在ubuntu上部署rrvideo生成mp4时报错

Error: Failed to launch the browser process!
[0402/002144.257527:ERROR:zygote_host_impl_linux.cc(100)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

解决方案: rrvideo 本地打包,在index.ts

this.browser = await puppeteer.launch({
headless: this.config.headless,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
})
增加args配置

使用 build 下 cli.js.和index.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@jmjoy @snail-boy and others