当你启动chromeium时(推荐在服务器上测试的时候先进入到node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome目录下执行./chrome进行测试,能成功运行代表通过puppeteer的api调用也能成功)你如果遇到例如:
error while loading shared libraries: libpangocairo-1.0.so.0: cannot open shared object file: No such file or directory
出现过运行Puppeteer时,报error while loading shared libraries:libpangocairo-1.0.so.0等依赖错误,可通过执行如下命令安装依赖包
yum -y install libX11 libXcomposite libXcursor libXdamage libXext libXi libXtst cups-libs libXScrnSaver libXrandr alsa-lib pango atk at-spi2-atk gtk3
推荐看下:https://www.jianshu.com/p/ea8a557f6407