首页 > 解决方案 > Puppeteer 在 Node 10 运行时中无法使用谷歌云功能

问题描述

我正在尝试以无头模式启动 google chrome 实例,但出现以下错误:

Failed to launch the browser process!
/workspace/node_modules/puppeteer/.local-chromium/linux-737027/chrome-linux/chrome: error while loading shared libraries: libgbm.so.1: cannot open shared object file: No such file or directory

我正在使用 puppeteer v3.0.0 和 nodejs 10 运行时。我该如何解决这个错误?

标签: node.jsgoogle-cloud-functionspuppeteer

解决方案


由于该帖子是关于云功能的,因此在部署该功能时,上述内容将不起作用。此问题是一个已知问题。

有一些关于恢复到 Puppeteer 2.1.0 的讨论, github puppeteer issues 5674

或者

有一个解决方法: github puppeteer issues 5704

我的经验:

  • 我尝试了解决方法,但没有奏效。也许它需要调整,但我没有时间调试。
  • 我恢复到 puppeteer 2.1.0,部署了 --memory 2048MB 的功能,并且成功运行。

推荐阅读