Puppeteer on Raspbian NodeJS

npm i puppeteer
# or "yarn add puppeteer"
const puppeteer = require('puppeteer');

(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({path: 'example.png'});

await browser.close();
Error: Failed to launch chrome!
/home/xxxx/.../node_modules/puppeteer/.local-chromium/liniux-641577/chrome-linux/chrome: Syntax error: word unexpected (expecting ") "

Solving the issue

If you are running an ARM processor, e.g. Raspberry PI, as stated above, I solved the issue with the following command:

const browser = await puppeteer.launch({
headless: true,
executablePath: '/usr/bin/chromium-browser',
args: ['--no-sandbox', '--disable-setuid-sandbox']



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store