CentOS 8 安装puppeteer 运行报错解决方式

运行代码提示

Error: Failed to launch the browser process!
/www/wwwroot/vtopworld/server/node_modules/_puppeteer@13.0.1@puppeteer/.local-chromium/linux-938248/chrome-linux/chrome: error while loading shared。******* cannot open shared object file: No such file or directory。

执行linux命令行

sudo yum install -y chromium

继续提示报错信息:
Error: Failed to launch the browser process!
[0115/105742.718414:ERROR:zygote_host_impl_linux.cc(90)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

解决代码:

puppetteer.launch({
   headless: true,
   args: ['--no-sandbox']
})

参考:

Fixed: CentOS 8 ---- Error: Failed to launch the browser process!

ERROR:zygote_host_impl_linux.cc(89) Running as root without --no-sandbox is not supported

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容