본문 바로가기

LINUX

CentOS 에서 puppeteer 실행시 libxkbcommon.so.0를 못찾을때 처리 방법

728x90

CentOS 에서 puppeteer 실행시 libxkbcommon.so.0를 못찾을때 처리 방법

CentOS에서 node 기반의 puppeteer를 실생하 다음과 같은 오류를 만났다

발생 에러 로그

(node:16300) UnhandledPromiseRejectionWarning: Error: Failed to launch the brows er process! /applications/service/teamstokengen/node_modules/puppeteer/.local-chromium/linux -901912/chrome-linux/chrome: error while loading shared libraries: libxkbcommon.so.0: cannot open shared object file: No such file or directory 

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

 at onClose (/applications/service/teamstokengen/node_modules/puppeteer/lib/c js/puppeteer/node/BrowserRunner.js:203:20) at Interface.<anonymous> (/applications/service/teamstokengen/node_modules/p uppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:68) at Interface.emit (events.js:326:22) at Interface.close (readline.js:416:8) at Socket.onend (readline.js:194:10) at Socket.emit (events.js:326:22) at endReadableNT (_stream_readable.js:1223:12) at processTicksAndRejections (internal/process/task_queues.js:84:21) (node:16300) 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 termin ate the node process on unhandled promise rejection, use the CLI flag `--unhandl ed-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejecti ons_mode). (rejection id: 1) (node:16300) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr ecated. In the future, promise rejections that are not handled will terminate th e Node.js process with a non-zero exit code.

해결방법으로는 다음 모듈을 설치하면된다.

$ yum install libxkbcommon-x11

원인으로는 x11 라이브러리 부재 문제로 실행이 안되었다.

참고 자료