安装 puppeteer 2 弹性豆茎

Posted

技术标签:

【中文标题】安装 puppeteer 2 弹性豆茎【英文标题】:installing puppeteer 2 elastickbeanstalk 【发布时间】:2020-07-09 06:16:14 【问题描述】:

我无法在 aws AWS Elastic Beanstalk 上部署 puppeteer。

我收到以下错误:

无法启动浏览器进程!\n/var/app/current/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: /lib64/libdbus-1.so.3: 否可用的版本信息(/usr/lib64/libatk-bridge-2.0.so.0 需要)\n/var/app/current/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome:/ lib64/libdbus-1.so.3:没有可用的版本信息(/usr/lib64/libatspi.so.0 需要)\n/var/app/current/node_modules/puppeteer/.local-chromium/linux-722234/ chrome-linux/chrome:符号查找错误:/var/app/current/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome:未定义符号:g_type_class_adjust_private_offset\n\n\n故障排除:https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md\n"

有人遇到过同样的问题并设法解决了吗?

【问题讨论】:

【参考方案1】:

需要添加多个共享库,见https://github.com/puppeteer/puppeteer/issues/765#issuecomment-358111805 你还需要'sudo yum install -y mesa-libgbm.x86_64' 看起来它只适用于 puppeteer2.0.0,更高版本失败,https://github.com/puppeteer/puppeteer/issues/5379

【讨论】:

【参考方案2】:

最后我用这个解决了:

packages:
  yum:
    compat-libtiff3: []

commands:
  chrome:
    command: curl https://intoli.com/install-google-chrome.sh | bash

【讨论】:

这对我不起作用并发送错误:Failed to launch the browser process!\n/var/app/current/node_modules/puppeteer/.local-chromium/linux-809590/chrome-linux/chrome: error while loading shared libraries: libgbm.so.1【参考方案3】:

这对我有用!

在 elastic beanstalk 中通过 SSH 远程连接

eb ssh environment_name

安装谷歌浏览器

curl https://intoli.com/install-google-chrome.sh | bash

来源: https://dev.to/achimoraites/a-developers-guide-to-run-puppeteer-on-elastic-beanstalk-no-ubuntu-linux-4pl5

【讨论】:

以上是关于安装 puppeteer 2 弹性豆茎的主要内容,如果未能解决你的问题,请参考以下文章

1.3-puppet安装

puppet安装和部署

CentOS 6.4安装Puppet

Puppet安装配置Puppet

Puppet安装部署篇

Puppeteer:如何在 ec2 服务器上安装 puppeteer