Puppeteer in WSL
July 4, 2023•45 words
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