报错
Error: Failed to launch the browser process!
chrome_crashpad_handler: --database is required
Try 'chrome_crashpad_handler --help' for more information.
[1696010:1696010:0516/034300.183315:ERROR:third_party/crashpad/crashpad/util/linux/socket.cc:120] recvmsg: Connection reset by peer (104)
TROUBLESHOOTING: https://pptr.dev/troubleshooting
at Interface.onClose (/www/wwwroot/xxx.xxx.xxx/node_modules/@puppeteer/browsers/src/launch.ts:507:11)
at Interface.emit (node:events:531:35)
at Interface.close (node:internal/readline/interface:528:10)
at Socket.onend (node:internal/readline/interface:254:10)
at Socket.emit (node:events:531:35)
at endReadableNT (node:internal/streams/readable:1696:12)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
安装google chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt-get install -f
具体代码
const browser = await puppeteer.launch({ headless: "new",executablePath: "/usr/bin/google-chrome",args: ['--disable-gpu', '--no-sandbox', '--disable-dev-shm-usage'] });
参考官方文档
https://pptr.nodejs.cn/troubleshooting#chrome-doesnt-launch-on-linux
评论已关闭