Puppeteer and Headless chrome

Install

npm config set puppeteer_download_host=https://npm.taobao.org/mirrors
npm i --save puppeteer

Troubleshooting

 Async problems

Make sure you are using Node 7.6 or above if you get this error:

async function run() {
  ^^^^^^^^

SyntaxError: Unexpected token function

Upgrade:

npm update -g

DO a cachec clean after upgrading:

npm cache clean -f

SSL error

You main need to upgrade openssl if you get an error like 'npm: relocation error: npm: symbol SSL_set_cert_cb, version libssl.so.10 not defined in file libssl.so.10 with link time reference'

yum update openssl

 Permission errors

If you get permission errors use --unsafe-perm=true

npm i --save puppeteer --allow-root --unsafe-perm=true

LibX errors

yum install libXcomposite.so.1
yum install libXcomposite
yum install libXcursor
yum install libXdamage
yum install libXext
yum install libXi

yum 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

yum instal nss