AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1210301
Accepted
Lmao 123
Lmao 123
Asked: 2020-02-14 10:47:29 +0800 CST2020-02-14 10:47:29 +0800 CST 2020-02-14 10:47:29 +0800 CST

Ubuntu 16.04 上的 Puppeteer 不起作用

  • 772

是否可以在 Ubuntu Server 16.04 上运行Puppeteer ?我得到这个错误。

(node:23213) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
/root/bin/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md

    at onClose (/root/bin/node_modules/puppeteer/lib/Launcher.js:750:14)
    at Interface.<anonymous> (/root/bin/node_modules/puppeteer/lib/Launcher.js:739:50)
    at Interface.emit (events.js:333:22)
    at Interface.close (readline.js:414:8)
    at Socket.onend (readline.js:192:10)
    at Socket.emit (events.js:333:22)
    at endReadableNT (_stream_readable.js:1201:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:23213) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:23213) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

如何解决此故障并让应用程序运行?

server command-line 16.04 maas javascript
  • 2 2 个回答
  • 5786 Views

2 个回答

  • Voted
  1. Best Answer
    Lmao 123
    2020-02-14T12:47:36+08:002020-02-14T12:47:36+08:00

    我修好了它。我必须更新我的 Linux (sudo-apt get update) 然后获取库。如果您不更新它,它将无法正常工作。

    sudo apt-get install gconf-service libasound2 libatk1.0-0 libatk-bridge2.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
    

    之后,我必须添加'--no-sandbox',启动代码(来自 myapp.js)。

    • 1
  2. Peter Drinnan
    2020-05-17T07:13:13+08:002020-05-17T07:13:13+08:00

    使用最新版本的铬,这对我有用。注意最近添加的依赖项。

    sudo apt-get install libgtk2.0-0 libgtk-3-0 libnotify-dev
    sudo apt-get install libgconf-2-4 libnss3 libxss1
    sudo apt-get install libasound2 libxtst6 xauth xvfb
    #recently added dependency
    sudo apt-get install libgbm-dev
    

    如果您使用的是 Docker,则可以将以下内容添加到 Docker 文件中。我也用 Docker 进行了测试,这很有效。

    RUN apt-get update && \ apt-get install -y libgtk2.0-0 libgtk-3-0 libnotify-dev \ libgconf-2-4 libnss3 libxss1 \ libasound2 libxtst6 xauth xvfb \ libgbm-dev
    

    在调用 puppeteer 时添加了参数'--no-sandbox'。这与Lmao的建议相同。如果没有这个选项,我无法让它工作。

    作为参考,我使用的是 Ubuntu 20,但这应该适用于任何发行版。

    • 1

相关问题

  • 文件权限如何工作?文件权限用户和组

  • 如何在 Vim 中启用全彩支持?

  • 如果在服务器机器上运行 Ubuntu 桌面版,性能损失是多少?

  • 将桌面版剥离为服务器版的最简单方法是什么?

  • 如何与无头服务器进行图形交互?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve