Puppeteer in WSL

Launch browser in Node.js

const browser = await puppeteer.launch({
    headless:true,
    args: [
        '--no-sandbox',    // https://stackoverflow.com/a/51038064/5581893
        "--single-process" // https://github.com/puppeteer/puppeteer/issues/6332#issuecomment-689015083
    ] 
});

Notes

headless:true

  • To launch in no-display env

–no-sandbox

  • A must, or it won’t work

–single-process

  • Required in WSL 2

You'll only receive email when they publish something new.

More from 19411
All posts