运行 puppeteer 报错 chrome: error while loading shared libraries: libpangocairo-1.0.so.0: cannot open sh...

运行 puppeteer 报错 chrome: error while loading shared libraries: libpangocairo-1.0.so.0: cannot open shared object file: No such file or directory

[root@eus_aps_crawler01:/data/www/vhosts/aps_task/httpdocs]# node test.js
(node:5490) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
/data/www/vhosts/aps_task/httpdocs/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome: error while loading shared libraries: libpangocairo-1.0.so.0: cannot open shared object file: No such file or directory


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

    at onClose (/data/www/vhosts/aps_task/httpdocs/node_modules/puppeteer/lib/Launcher.js:348:14)
    at Interface.helper.addEventListener (/data/www/vhosts/aps_task/httpdocs/node_modules/puppeteer/lib/Launcher.js:337:50)
    at Interface.emit (events.js:203:15)
    at Interface.close (readline.js:397:8)
    at Socket.onend (readline.js:173:10)
    at Socket.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1129:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:5490) 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:5490) [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.



# 分析:pango版本太高,需要降到低版本
解决办法:
[root@eus_aps_crawler01:~]# rpm -qa|grep pango
pango-1.42.4-4.el7_7.x86_64
[root@eus_aps_crawler01:~]# rpm -e --nodeps pango-1.42.4-4.el7_7.x86_64
# 下载 pango-1.40.4安装
# wget https://buildlogs.centos.org/c7.1708.00/pango/20170805142921/1.40.4-1.el7.x86_64/pango-1.40.4-1.el7.x86_64.rpm
[root@eus_aps_crawler01:~]# yum localinstall pango-1.40.4-1.el7.x86_64.rpm

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值