Linux Azure Web 应用程序上的 Puppeteer [英] Puppeteer on Linux Azure Web Apps

查看:54
本文介绍了Linux Azure Web 应用程序上的 Puppeteer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Linux Azure Web 应用程序上运行 Puppeteer.但是日志显示

<块引用>

/node_modules/puppeteer/.local-chromium/linux-782078/chrome-linux/chrome:加载共享库时出错:libgobject-2.0.so.0:无法打开共享目标文件:没有那个文件或目录

我认为这是由于 Azure 上的 Linux 发行版.我的问题是:这是一个死胡同还是我可以做些什么?

解决方案

看起来应用服务中的默认环境没有运行无头 Chromium 的必要依赖项.但是,您可以在安装了依赖项的自定义 Docker 映像中的应用服务上运行您的应用程序.这是一个很好的起点:https://github.com/buildkite/docker-puppeteer>

I am trying to run the Puppeteer on Linux Azure Web Apps. But log shows

/node_modules/puppeteer/.local-chromium/linux-782078/chrome-linux/chrome: error while loading shared libraries: libgobject-2.0.so.0: cannot open shared object file: No such file or directory

I think it is due to the Linux distribution on Azure. And my question: Is it a dead end or is there something I can do about it?

解决方案

Looks like the default environments in App Service do not have the necessary dependencies for running headless Chromium. You can, however, run your app on App Service in a custom Docker image the dependencies installed. Here's a good starting point: https://github.com/buildkite/docker-puppeteer

这篇关于Linux Azure Web 应用程序上的 Puppeteer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆