linux运行puppeteer报错 Failed to launch chrome!

(node:86653) UnhandledPromiseRejectionWarning: Error: **Failed to launch chrome!**

(chrome:86664): Gtk-WARNING **: 10:12:53.198: cannot open display: 


TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
原因是因为使用了headless:false参数,Linux是没有图形界面的所有没有办法运行。
如果puppeteer安装失败可以使用淘宝的镜像:
npm config set puppeteer_download_host = https://npm.taobao.org/mirrors

chaos-fe

posted @   一颗小行星-  阅读(539)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
点击右上角即可分享
微信分享提示