Created
April 25, 2020 22:34
-
-
Save yongzhihuang/9f2797f6c17ee7ddca585a56afc2d724 to your computer and use it in GitHub Desktop.
How to get Puppeteer to run on server side Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Step 1, install dependencies | |
sudo apt-get install ca-certificates fonts-liberation gconf-service libappindicator1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils | |
// Step 2, if you're running puppeteer as root, you need to start Puppeteer with --no-sandbox argument | |
const browser = await puppeteer.launch({ headless: true, args: ['--no-sandbox'] }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment