본문 바로가기

programming/nodeJS

nodeJS puppeteer 라이브러리 CentOS에서 실행시 오류 해결방법 공유

오류 메시지 ::

(node:21758) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Failed to launch chrome!
~~~~~~~/node_modules/puppeteer/.local-chromium/linux-526987/chrome- linux/chrome: 3:
~~~~~~~/node_modules/puppeteer/.local-chromium/linux- 526987/chrome-linux/chrome: Syntax error: ")" unexpected
TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md (node:21758)
[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.

 

Solution :: <Chromium Dependencies Install>

yum install install pango.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXtst.x86_64 cups-libs.x86_64 libXScrnSaver.x86_64 libXrandr.x86_64 GConf2.x86_64 alsa-lib.x86_64 atk.x86_64 gtk3.x86_64 ipa-gothic-fonts xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc

 

환경 : CentOS 7 x86_64

puppeteer version : 1.18.1

 

x86_64가 아닌 분들은 해당 숫자만 변경하시어 패키지 설치하시면 되겠쥬

 

reference : https://github.com/GoogleChrome/puppeteer/issues/2857