質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Chrome

Google Chromeは携帯、テレビ、デスクトップなどの様々なプラットフォームで利用できるウェブブラウザです。Googleが開発したもので、Blink (レンダリングエンジン) とアプリケーションフレームワークを使用しています。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

Q&A

解決済

1回答

10352閲覧

Puppeteerの実行時にlibX11.so.6ライブラリーエラー

kuniatsu

総合スコア141

Chrome

Google Chromeは携帯、テレビ、デスクトップなどの様々なプラットフォームで利用できるウェブブラウザです。Googleが開発したもので、Blink (レンダリングエンジン) とアプリケーションフレームワークを使用しています。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

0グッド

1クリップ

投稿2018/12/27 04:24

編集2018/12/27 05:43

Vargrantで建てたCentOS7で
puppeteerの実行時に下記のエラーが発生します。

error

1[vagrant@localhost puppeteer]$ node image.js 2(node:21799) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome! 3/home/vagrant/crawler/node_modules/puppeteer/.local-chromium/linux-609904/chrome-linux/chrome: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory 4 5 6TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md 7 8 at onClose (/home/vagrant/crawler/node_modules/puppeteer/lib/Launcher.js:342:14) 9 at Interface.helper.addEventListener (/home/vagrant/crawler/node_modules/puppeteer/lib/Launcher.js:331:50) 10 at Interface.emit (events.js:194:15) 11 at Interface.close (readline.js:397:8) 12 at Socket.onend (readline.js:173:10) 13 at Socket.emit (events.js:194:15) 14 at endReadableNT (_stream_readable.js:1129:12) 15 at process.internalTickCallback (internal/process/next_tick.js:72:19) 16(node:21799) 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(). (rejection id: 1) 17(node:21799) [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. 18 19

libX11.so.6がないようなので、yum provides */libX11.so.6を実行しましたがかわりません。

[vagrant@localhost puppeteer]$ sudo yum provides */libX11.so.6 読み込んだプラグイン:fastestmirror Loading mirror speeds from cached hostfile * base: mirror.0x.sg * extras: mirror.nus.edu.sg * updates: mirror.0x.sg base/7/x86_64/filelists_db | 7.1 MB 00:00:02 extras/7/x86_64/filelists_db | 189 kB 00:00:00 updates/7/x86_64/filelists_db | 1.4 MB 00:00:00 libX11-1.6.5-2.el7.i686 : Core X11 protocol client library リポジトリー : base 一致 : ファイル名 : /usr/lib/libX11.so.6 libX11-1.6.5-2.el7.x86_64 : Core X11 protocol client library リポジトリー : base 一致 : ファイル名 : /usr/lib64/libX11.so.6 [vagrant@localhost puppeteer]$ node image.js (node:21866) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome! /home/vagrant/crawler/node_modules/puppeteer/.local-chromium/linux-609904/chrome-linux/chrome: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md at onClose (/home/vagrant/crawler/node_modules/puppeteer/lib/Launcher.js:342:14) at Interface.helper.addEventListener (/home/vagrant/crawler/node_modules/puppeteer/lib/Launcher.js:331:50) at Interface.emit (events.js:194:15) at Interface.close (readline.js:397:8) at Socket.onend (readline.js:173:10) at Socket.emit (events.js:194:15) at endReadableNT (_stream_readable.js:1129:12) at process.internalTickCallback (internal/process/next_tick.js:72:19) (node:21866) 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(). (rejection id: 1) (node:21866) [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.

この問題の解決方法をご存知の方はいらっしゃいますか?
よろしくお願いします。

追記
依存関係を確認
参考:https://qiita.com/one-kelvin/items/07bf9b99288e8ecfa4a2

[vagrant@localhost puppeteer]$ ldd /home/vagrant/crawler/node_modules/puppeteer/.local-chromium/linux-609904/chrome-linux/chrome linux-vdso.so.1 => (0x00007ffe2a9b1000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f6dfdbbd000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f6dfd9a1000) librt.so.1 => /lib64/librt.so.1 (0x00007f6dfd799000) libX11.so.6 => not found

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

依存パッケージを調べ

yum whatprovides */libX11.so.6

インストールを行い解決した。

sudo yum install -y libX11

投稿2018/12/27 06:07

kuniatsu

総合スコア141

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問