在Mac上调试无问题,放到阿里云上运行会报错。

 

需要先安装依赖,

yum install pango.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXtst.x86_64 cups-libs.x86_64 libXScrnSaver.x86_64 libXrandr.x86_64 GConf2.x86_64 alsa-lib.x86_64 atk.x86_64 gtk3.x86_64 ipa-gothic-fonts xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc -y

然后在启动时,设置非沙盒模式即可:

const browser = await puppeteer.launch({
headless: CONF.HEADLESS,
timeout: 600000,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
handleSIGINT: false
});

相关文章:

  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
  • 2021-08-11
  • 2021-05-28
  • 2021-09-27
  • 2021-11-17
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-23
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案