在安装puppeteer过程中遇到一些错误,记录一下

首先可能遇到node install.js错误,可以使用一下命令参数安装puppeteer

npm i --save puppeteer --ignore-scripts
  • 1
或者先执行一下命令再安装puppeteer
npm config set unsafe-perm true
npm i puppeteer

Troubleshooting.或直接执行一下命令

sudo apt install 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
  • 1

还有sandbox 问题,可以尝试在无沙箱模式下运行puppeteer

const browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']});
  • 1
 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
  • 2022-03-01
  • 2021-11-02
  • 2022-02-09
  • 2021-11-14
  • 2022-01-08
猜你喜欢
  • 2022-12-23
  • 2022-03-07
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案