启动 puppeteer 时遇到问题
(node:13392) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
/var/www/html/node_modules/puppeteer/.local-chromium/linux-674921/chrome-linux/chrome: error while loading shared libraries: libatk-bridge-2.0.so.0: cannot open shared object file: No such file or directory
我找到了https://pkgs.org/download/libatk-bridge-2.0.so.0()(64bit)并选择了CentOS 7版本,因为没有CentOS 6 根据我输入的内容
yum install at-spi2-atk
但是得到了
Loaded plugins: fastestmirror
Setting up Install Process
Repository remi-php71 is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* atomic: www6.atomicorp.com
* base: mirror.checkdomain.de
* epel: mirror.wiuwiu.de
* extras: mirror.checkdomain.de
* remi: mirror.23media.com
* remi-php54: mirror.23media.com
* remi-php71: mirror.23media.com
* remi-safe: mirror.23media.com
* updates: mirror.imt-systems.com
* webtatic: uk.repo.webtatic.com
No package at-spi2-atk available.
Error: Nothing to do
顺便说一句,在 Windows 7 puppeteer 中可以解决任何问题
CentOS 6,节点 v10.16.1
const puppeteer = require('puppeteer');
const url = 'https://thepage.com.ua/';
puppeteer
.launch(function() {
console.log('puppeteer launched')
})
.then(function(browser) {
console.log('browser OK')
return browser.newPage();
})
yum install gtk3
提供libatk-bridge-2.0.so.0