Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Node.js, PHP and APIs

Puppeteer launch fails because /usr/bin/chromium-browser is only a snap wrapper

Your error

Error: Failed to launch the browser process!1 more line it can show

Fix it fast

Most common cause, 1 of 3

The launch code hard-codes executablePath: '/usr/bin/chromium-browser'

Remove executablePath from the launch call and let Puppeteer start the Chrome for Testing build it ships with; its docs say it only tests and guarantees those binaries.

Fix
// before: puppeteer.launch({ executablePath: '/usr/bin/chromium-browser' })
const browser = await puppeteer.launch();

# shell, as the user that runs the script
npx puppeteer browsers install chrome
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

Failed to launch the browser process with Command '/usr/bin/chromium-browser' requires the chromium snap to be installed means Puppeteer was told to run Ubuntu's chromium-browser, which is only a transitional wrapper for the Chromium snap. Where snapd is not running (WSL, chroots, containers) the snap never arrived. Drop that path and use Puppeteer's own Chrome for Testing. Ubuntu 20.04 to 24.04.

  • Applies to Puppeteer 25.18, Ubuntu 24.04 (chromium-browser 2:1snap1-0ubuntu2), WSL 2, Node.js 22, 24 and 26
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

Find where the chromium-browser path comes from and what that file really is. A hit in your code is cause 1, a value in the environment variable is cause 2, and a Dockerfile that installs the package is cause 3. A dpkg version containing snap confirms the file is the transitional wrapper.

Run this first
grep -rn "chromium-browser" --include=*.js --include=*.mjs --include=*.ts --include=Dockerfile . | grep -v node_modules
echo "PUPPETEER_EXECUTABLE_PATH=$PUPPETEER_EXECUTABLE_PATH"
dpkg -s chromium-browser | grep '^Version'

Then find the line you see in this list and open its fix:

  1. 1The launch code hard-codes executablePath: '/usr/bin/chromium-browser'grep finds executablePath: '/usr/bin/chromium-browser' in your script, and dpkg shows a version like 2:1snap1-0ubuntu2
  2. 2PUPPETEER_EXECUTABLE_PATH still points at the wrapperYour code passes no executablePath, yet the echo prints PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
  3. 3An Ubuntu-based Docker image installs chromium-browser with aptThe Dockerfile starts FROM ubuntu (or an image built on it) and runs apt-get install chromium-browser

What does the error look like?

  • Error: Failed to launch the browser process!
  • Command '/usr/bin/chromium-browser' requires the chromium snap to be installed.

Cause 1 of 3

The launch code hard-codes executablePath: '/usr/bin/chromium-browser'

You seegrep finds executablePath: '/usr/bin/chromium-browser' in your script, and dpkg shows a version like 2:1snap1-0ubuntu2

Check

Puppeteer reports Failed to launch the browser process and prints the wrapper's own message, because on Ubuntu the chromium-browser package is a transitional package that only installs the Chromium snap. Its changelog says the package no longer tries to install the snap where snapd is not running, naming chroots and WSL, and a Canonical developer on the same bug states that the user must then install the snap by hand. So the file exists but has no browser behind it.

Check
snap list chromium

Fix

Remove executablePath from the launch call and let Puppeteer start the Chrome for Testing build it ships with; its docs say it only tests and guarantees those binaries. Download that browser once for the current user.

Fix
// before: puppeteer.launch({ executablePath: '/usr/bin/chromium-browser' })
const browser = await puppeteer.launch();

# shell, as the user that runs the script
npx puppeteer browsers install chrome

Verify

Chrome for Testing sits in the default cache folder, and the script now opens pages.

Verify
ls ~/.cache/puppeteer
node scrape.js

Confirmed by bugs.launchpad.net

Did this fix it?

Cause 2 of 3

PUPPETEER_EXECUTABLE_PATH still points at the wrapper

You seeYour code passes no executablePath, yet the echo prints PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

Check

Puppeteer reads the browser path from the PUPPETEER_EXECUTABLE_PATH variable, and its configuration guide says environment variables always override configuration file options. Alpine instructions set this variable to /usr/bin/chromium-browser, where Alpine has a real Chromium package; copied into a shell profile, a .env file or a CI setting on Ubuntu, it sends every launch to the snap wrapper.

Check
grep -rn "PUPPETEER_EXECUTABLE_PATH" ~/.bashrc ~/.profile ~/.zshrc .env* 2>/dev/null

Fix

Delete the variable where it is set, open a new shell, and install Puppeteer's browser so the default path has something to launch.

Fix
unset PUPPETEER_EXECUTABLE_PATH
# remove the export line from the file grep found, then:
npx puppeteer browsers install chrome

Verify

A fresh shell prints an empty value, and the launch succeeds.

Verify
echo "PUPPETEER_EXECUTABLE_PATH=$PUPPETEER_EXECUTABLE_PATH"
node scrape.js

Confirmed by pptr.dev

Did this fix it?

Cause 3 of 3

An Ubuntu-based Docker image installs chromium-browser with apt

You seeThe Dockerfile starts FROM ubuntu (or an image built on it) and runs apt-get install chromium-browser

Check

An image build is one more place where snapd is not running, so the same transitional package lands without the snap and the container ships only the wrapper script. Puppeteer's postinstall download may be missing too, because some package managers now block dependency install scripts, which Puppeteer's troubleshooting guide lists as a reason the browser never arrives.

Check
docker run --rm my-scraper-image dpkg -s chromium-browser | grep '^Version'

Fix

Drop the apt package and install Chrome for Testing with its Ubuntu system libraries in the build. The --install-deps flag works on Ubuntu and Debian and needs root, so run it before any USER line in the Dockerfile. If the app later runs as another user, put the browser in a shared folder with PUPPETEER_CACHE_DIR.

Fix
FROM ubuntu:24.04
# ... install Node.js and copy the app ...
ENV PUPPETEER_CACHE_DIR=/opt/puppeteer
RUN npm ci && npx puppeteer browsers install chrome --install-deps

Verify

The rebuilt image has the browser in the shared cache folder and no chromium-browser package.

Verify
docker run --rm my-scraper-image ls /opt/puppeteer

Confirmed by pptr.dev

Did this fix it?

How do I stop it coming back?

  • Leave executablePath unset unless you manage the browser yourself; Puppeteer is released against one Chrome for Testing version.
  • Add an explicit npx puppeteer browsers install chrome step to CI and Dockerfiles instead of relying on the postinstall download.
  • Keep Puppeteer settings in a .puppeteerrc.cjs file in the repository, not in shell profiles, so a stale browser path shows up in code review.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine on the same stack: TaxiDex, Workforce.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.