question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Puppeteer doesn't run under WSL (Windows subsystem for Linux)

See original GitHub issue

On Ubuntu 16.04.3 LTS via WSL (Linux pc-name 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux).

Gives this error:

ERROR { Error: kill ESRCH
    at Object._errnoException (util.js:1024:11)
    at process.kill (internal/process.js:183:18)
    at forceKillChrome (/mnt/c/Users/me/code/node_modules/puppeteer/lib/Launcher.js:169:19)
    at Function.launch (/mnt/c/Users/me/code/node_modules/puppeteer/lib/Launcher.js:144:7)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) code: 'ESRCH', errno: 'ESRCH', syscall: 'kill' }
ERROR { Error: kill ESRCH
    at Object._errnoException (util.js:1024:11)
    at process.kill (internal/process.js:183:18)
    at forceKillChrome (/mnt/c/Users/me/code/node_modules/puppeteer/lib/Launcher.js:169:19)
    at Function.launch (/mnt/c/Users/me/code/node_modules/puppeteer/lib/Launcher.js:144:7)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) code: 'ESRCH', errno: 'ESRCH', syscall: 'kill' }

Have tried:

sudo apt install gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 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 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

… which doesn’t help.

Only other mention I can find of Puppeteer on WSL is https://github.com/GoogleChrome/puppeteer/issues/290#issuecomment-322964612.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:39
  • Comments:62

github_iconTop GitHub Comments

67reactions
vielhubercommented, Sep 23, 2019

This works for me:

const browser = await puppeteer.launch({
       args: [
            '--disable-gpu',
            '--disable-dev-shm-usage',
            '--disable-setuid-sandbox',
            '--no-first-run',
            '--no-sandbox',
            '--no-zygote',
            '--single-process',
       ]
  })
59reactions
junminstoragecommented, Jul 14, 2018

The following works for me in latest WSL:

npm install puppeteer
sudo apt-get install chromium-browser

const puppeteer = require('puppeteer');

(async() => {
  const browser = await puppeteer.launch({executablePath: '/usr/bin/chromium-browser'});
  console.log(await browser.version());
  const page = await browser.newPage();
  await page.goto('https://google.com');
  await page.screenshot({path: 'google.png'});
  await browser.close();
})();
Read more comments on GitHub >

github_iconTop Results From Across the Web

Using puppeteer on Windows with WSL - ohaleks
I installed Ubuntu as my subsystem, as (keep calm please) it doesn't really matter for just being a development tool, but I'm pretty...
Read more >
Troubleshooting puppeteer in WSL2 - Chaos and Penguins
I'm working on a small project to generate image files from HTML using a web browser. This is something I've toyed with for...
Read more >
Running Puppeteer on WSL2 controlling the Chrome on ...
I'm trying to get to run puppeteer on WSL2. I've tried using a remote display via VcXsvr but my firewall settings and host...
Read more >
Troubleshooting - Puppeteer
Running Puppeteer on WSL (Windows subsystem for Linux)​ ... See this thread with some tips specific to WSL. In a nutshell, you need...
Read more >
Puppeteer & Core on WSL2 - Reddit
I'm aware with the issues with Puppeteer and WSL2. ... Use Chrome in Ubuntu on Windows Subsystem Linux · Scott Spence does not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found