Puppeteer "Could not find expected browser (chrome)" in CI
Puppeteer launches a specific Chromium revision it expects in its cache. If the download was skipped (PUPPETEER_SKIP_DOWNLOAD), or the cache was not restored, that revision is absent and launch fails with "Could not find expected browser".
What this error means
puppeteer.launch() throws "Could not find expected browser (chrome) locally. Run npx puppeteer browsers install chrome to download the browser." during a CI run.
Error: Could not find expected browser (chrome) locally.
Run `npx puppeteer browsers install chrome` to download the correct Chromium revision.Common causes
The browser download was skipped at install
PUPPETEER_SKIP_DOWNLOAD (or PUPPETEER_SKIP_CHROMIUM_DOWNLOAD) was set during npm install, so no Chromium was fetched.
The Puppeteer cache was not restored in CI
A cached ~/.cache/puppeteer was expected but not restored, so the expected revision is missing on the runner.
How to fix it
Install the browser explicitly
- Run
npx puppeteer browsers install chromeafter npm install. - Do not set PUPPETEER_SKIP_DOWNLOAD unless you provide a browser another way.
- Re-run so Puppeteer finds the expected revision.
- run: npm ci
- run: npx puppeteer browsers install chromeOr point Puppeteer at an installed Chrome
If you install Chrome yourself, set executablePath and the skip-download flag together so Puppeteer uses your binary.
const browser = await puppeteer.launch({
executablePath: '/usr/bin/google-chrome',
});How to prevent it
- Run
puppeteer browsers install chromein CI when download was skipped. - Cache and restore ~/.cache/puppeteer with a key tied to the Puppeteer version.
- If using a system Chrome, set executablePath explicitly.