CentOS 7でライブラリ不足エラーが発生した場合の対処方法

ライブラリ不足のエラー

libX11.so

実行したときに、以下のようなlibX11.so.6のエラーが発生する場合

$ node test.js
(node:4838) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
/home/vagrant/work/puppeteer/node_modules/puppeteer/.local-chromium/linux-70691
5/chrome-linux/chrome: error while loading shared libraries: libX11.so.6: canno
t open shared object file: No such file or directory
....
....
(node:4838) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate t
he Node.js process with a non-zero exit code.
以下でインストール
yum install libX11

libXcomposite.so.1

実行したときに、以下のようなlibXcomposite.so.1のエラーが発生する場合

$ node test.js
(node:4886) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
/home/vagrant/work/puppeteer/node_modules/puppeteer/.local-chromium/linux-70691
5/chrome-linux/chrome: error while loading shared libraries: libXcomposite.so.1
: cannot open shared object file: No such file or directory
....
....
(node:4886) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate t
he Node.js process with a non-zero exit code.
以下でインストール
yum install libXcomposite

libXcursor.so.1

実行したときに、以下のようなlibXcursor.so.1のエラーが発生する場合

$ node test.js
(node:4926) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
/home/vagrant/work/puppeteer/node_modules/puppeteer/.local-chromium/linux-70691
5/chrome-linux/chrome: error while loading shared libraries: libXcursor.so.1: c
annot open shared object file: No such file or directory
....
....
(node:4926) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate t
he Node.js process with a non-zero exit code.
以下でインストール
yum install libXcursor

libXdamage.so.1

$ node test.js
(node:4974) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
/home/vagrant/work/puppeteer/node_modules/puppeteer/.local-chromium/linux-70691
5/chrome-linux/chrome: error while loading shared libraries: libXdamage.so.1: c
annot open shared object file: No such file or directory
....
....
(node:4974) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate t
he Node.js process with a non-zero exit code.
以下でインストール
yum install libXdamage

libXext.so.6

実行したときに、以下のようなlibXext.so.6のエラーが発生する場合

$ node test.js
(node:5011) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
/home/vagrant/work/puppeteer/node_modules/puppeteer/.local-chromium/linux-70691
5/chrome-linux/chrome: error while loading shared libraries: libXext.so.6: cann
ot open shared object file: No such file or directory
....
....
(node:5011) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate t
he Node.js process with a non-zero exit code.
以下でインストール
yum install libXext

libXi.so.6

実行したときに、以下のようなlibXi.so.6のエラーが発生する場合

$ node test.js
(node:5049) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
/home/vagrant/work/puppeteer/node_modules/puppeteer/.local-chromium/linux-70691
5/chrome-linux/chrome: error while loading shared libraries: libXi.so.6: cannot
 open shared object file: No such file or directory
....
....
(node:5049) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate t
he Node.js process with a non-zero exit code.
以下でインストール
yum install libXi

libXtst.so.6

実行したときに、以下のようなlibXtst.so.6のエラーが発生する場合

$ node test.js
(node:5355) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
/home/vagrant/work/puppeteer/node_modules/puppeteer/.local-chromium/linux-70691
5/chrome-linux/chrome: error while loading shared libraries: libXtst.so.6: cann
ot open shared object file: No such file or directory
....
....
(node:5355) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate t
he Node.js process with a non-zero exit code.
yum install libXtst

libXss.so.1

実行したときに、以下のようなlibXss.so.1のエラーが発生する場合

$ node test.js
(node:5404) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
/home/vagrant/work/puppeteer/node_modules/puppeteer/.local-chromium/linux-70691
5/chrome-linux/chrome: error while loading shared libraries: libXss.so.1: canno
t open shared object file: No such file or directory
....
....
(node:5404) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate t
he Node.js process with a non-zero exit code.

確認すると、libXss.so.1は、libXScrnSaverに含まれます。

# yum whatprovides libXss.so.1
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: hk.mirrors.thegigabit.com
 * extras: ftp.iij.ad.jp
 * remi-safe: ftp.riken.jp
 * updates: ftp.iij.ad.jp
libXScrnSaver-1.2.2-6.1.el7.i686 : X.Org X11 libXss runtime library
Repo        : base
Matched from:
Provides    : libXss.so.1
そのため、libXScrnSaver をインストールします。
yum install libXScrnSaver

libXrandr.so.2

実行したときに、以下のようなlibXrandr.so.2のエラーが発生する場合

$ node test.js
(node:5448) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
/home/vagrant/work/puppeteer/node_modules/puppeteer/.local-chromium/linux-70691
5/chrome-linux/chrome: error while loading shared libraries: libXrandr.so.2: ca
nnot open shared object file: No such file or directory
....
....
(node:5448) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate t
he Node.js process with a non-zero exit code.
以下でインストール
yum install libXrandr

libasound.so.2

実行したときに、以下のようなlibasound.so.2のエラーが発生する場合

$ node test.js
(node:5502) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
/home/vagrant/work/puppeteer/node_modules/puppeteer/.local-chromium/linux-70691
5/chrome-linux/chrome: error while loading shared libraries: libasound.so.2: ca
nnot open shared object file: No such file or directory
....
....
(node:5502) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate t
he Node.js process with a non-zero exit code.

確認すると、alisa-libに含まれているということで

# yum whatprovides libasound.so.2
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * remi-safe: ftp.riken.jp
 * updates: ftp.iij.ad.jp
alsa-lib-1.1.8-1.el7.i686 : The Advanced Linux Sound Architecture (ALSA) library
Repo        : base
Matched from:
Provides    : libasound.so.2
以下でインストール
yum install alsa-lib

実行したときに、以下のようなのエラーが発生する場合

$ node test.js
(node:5549) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
/home/vagrant/work/puppeteer/node_modules/puppeteer/.local-chromium/linux-70691
5/chrome-linux/chrome: error while loading shared libraries: libatk-1.0.so.0: c
annot open shared object file: No such file or directory
....
....
(node:5549) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate h
e Node.js process with a non-zero exit code.

確認すると、atkに含まれているということで

# yum whatprovides libatk-1.0.so.0
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: hk.mirrors.thegigabit.com
 * extras: ftp.iij.ad.jp
 * remi-safe: ftp.riken.jp
 * updates: ftp.iij.ad.jp
atk-2.28.1-1.el7.i686 : Interfaces for accessibility support
Repo        : base
Matched from:
Provides    : libatk-1.0.so.0
以下でインストール
yum install atk

libatk-bridge-2.0.so.0

実行したときに、以下のようなlibatk-bridge-2.0.so.0のエラーが発生する場合

$ node test.js
(node:5596) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
/home/vagrant/work/puppeteer/node_modules/puppeteer/.local-chromium/linux-70691
5/chrome-linux/chrome: error while loading shared libraries: libatk-bridge-2.0.
so.0: cannot open shared object file: No such file or directory
....
....
(node:5596) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate t
he Node.js process with a non-zero exit code.

確認すると、at-spi2-atkに含まれているということで

# yum whatprovides libatk-bridge-2.0.so.0
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: hk.mirrors.thegigabit.com
 * extras: ftp.iij.ad.jp
 * remi-safe: ftp.riken.jp
 * updates: ftp.iij.ad.jp
at-spi2-atk-2.26.2-1.el7.i686 : A GTK+ module that bridges ATK to D-Bus at-spi
Repo        : base
Matched from:
Provides    : libatk-bridge-2.0.so.0
以下でインストール
yum install at-spi2-atk

libpangocairo-1.0.so.0

実行したときに、以下のようなlibpangocairo-1.0.so.0のエラーが発生する場合

$ node test.js
(node:5647) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
/home/vagrant/work/puppeteer/node_modules/puppeteer/.local-chromium/linux-70691
5/chrome-linux/chrome: error while loading shared libraries: libpangocairo-1.0.
so.0: cannot open shared object file: No such file or directory
....
....
(node:5647) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate t
he Node.js process with a non-zero exit code.

確認すると、pangoに含まれているということで

# yum whatprovides libpangocairo-1.0.so.0
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: hk.mirrors.thegigabit.com
 * extras: ftp.iij.ad.jp
 * remi-safe: ftp.riken.jp
 * updates: ftp.iij.ad.jp
pango-1.42.4-3.el7.i686 : System for layout and rendering of internationalized text
Repo        : base
Matched from:
Provides    : libpangocairo-1.0.so.0



pango-1.42.4-4.el7_7.i686 : System for layout and rendering of internationalized text
Repo        : updates
Matched from:
Provides    : libpangocairo-1.0.so.0
以下でインストール
yum install pango

libgtk-3.so.0

実行したときに、以下のような libgtk-3.so.0のエラーが発生する場合

$ node test.js
(node:5722) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
/home/vagrant/work/puppeteer/node_modules/puppeteer/.local-chromium/linux-70691
5/chrome-linux/chrome: error while loading shared libraries: libgtk-3.so.0: can
not open shared object file: No such file or directory
....
....
(node:5722) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate t
he Node.js process with a non-zero exit code.
以下でインストール
yum install gtk3