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

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。