gpt4 book ai didi

node.js - 无法使用 Puppeteer -- 错误 : Failed to launch chrome

转载 作者:太空宇宙 更新时间:2023-11-04 02:54:20 26 4
gpt4 key购买 nike

这是我收到的错误。当测试代码在 Gitlab CI 中运行时会发生这种情况。

但是,它在本地运行良好。有人请帮忙吗?

2036 $ npm test

2037 > 10_auth@1.1.3 test /builds/brhanuh/domestic-repair

2038 > jest --coverage 'unitTests/'

2039 Error: Failed to launch chrome!

2040 /builds/brhanuh/domestic-repair/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome: error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory

最佳答案

使用安装缺少的软件包

sudo apt install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

感谢 @coldner the puppetteer issue tracker用于组装所需的包装。

如果遇到 E: Unable to located package 错误,请运行 sudo apt-get update

关于node.js - 无法使用 Puppeteer -- 错误 : Failed to launch chrome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59112956/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com