Maaz Zindani

Loading the index…

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

puppeteer-core refuses to launch without a browser path or channel

ErrorAn `executablePath` or `channel` must be specified for `puppeteer-core`

Short answer

puppeteer-core never downloads a browser, so launch needs to be told which one to use. Pass executablePath with the path of a Chrome or Chromium you installed, or channel when Chrome sits in its standard location. Or switch to the puppeteer package, which downloads Chrome for Testing when you install it.

  • Applies to Puppeteer (current release), Node.js 22, Node.js 24, Ubuntu 24.04
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Check which Puppeteer package the project really imports. The error only comes from puppeteer-core.

    grep -rn "puppeteer" package.json
    grep -rn "from 'puppeteer\|require('puppeteer" src/
  2. 2Match what you see, then jump to its fix

    1. 1The import is puppeteer-core and launch() has no executablePath or channelpuppeteer-core is used and no browser is namedFix
    2. 2No other part of the project depends on a system ChromeThe project only needs a browser it can download itselfFix
    3. 3The same code works on one machine and fails in Docker or CIThe path is set by an environment variable that is empty in this environmentFix

What does the error look like?

  • An `executablePath` or `channel` must be specified for `puppeteer-core`

Cause 1 of 3

puppeteer-core is used and no browser is named

1Check

The Puppeteer docs say puppeteer-core does not download Chrome when installed, and you launch it with an explicit executablePath, or with channel when the browser is in a standard location.

which google-chrome-stable chromium chromium-browser

2Fix

Pass the path of a browser that exists on the machine, or a channel.

import puppeteer from 'puppeteer-core';

const browser = await puppeteer.launch({
  executablePath: '/usr/bin/google-chrome-stable',
  // or: channel: 'chrome',
});

3Verify

The script opens a page and prints its title.

node -e "import('puppeteer-core').then(async p => { const b = await p.default.launch({ executablePath: '/usr/bin/google-chrome-stable' }); console.log(await b.version()); await b.close(); })"

Confirmed by pptr.dev

Did this fix it?

Cause 2 of 3

The project only needs a browser it can download itself

1Check

The full puppeteer package downloads a recent Chrome for Testing when you install it and keeps it in the cache folder under your home directory.

ls ~/.cache/puppeteer

2Fix

Replace puppeteer-core with puppeteer, and import that. Then launch needs no path.

npm uninstall puppeteer-core
npm install puppeteer

3Verify

launch() works with no options.

node -e "import('puppeteer').then(async p => { const b = await p.default.launch(); console.log(await b.version()); await b.close(); })"

Confirmed by pptr.dev

Did this fix it?

Cause 3 of 3

The path is set by an environment variable that is empty in this environment

1Check

The Alpine Docker example in the Puppeteer docs sets PUPPETEER_EXECUTABLE_PATH to a system Chromium, and code can read it from the environment. A variable that is unset in CI leaves the path undefined.

echo "$PUPPETEER_EXECUTABLE_PATH"

2Fix

Set the variable in the image or pipeline, or fall back to a fixed path in code.

const browser = await puppeteer.launch({
  executablePath: process.env.PUPPETEER_EXECUTABLE_PATH || '/usr/bin/chromium-browser',
});

3Verify

Run the same container and print the browser version.

docker run --rm my-image node check-browser.mjs

Confirmed by pptr.dev

Did this fix it?

How do I stop it coming back?

  • Pick one package on purpose: puppeteer for a self-contained browser, puppeteer-core for a browser you manage.
  • Keep the browser path in one environment variable with the same name in every environment.
  • Print the browser version at start-up so a wrong path fails early and loudly.

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 built on the same technologies:

Related fixes

Next step

Want this handled for good?

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