Puppeteer "Could not find Chromium (rev. X)" in CI
Puppeteer could not locate the Chromium build it expects. Either the post-install download was skipped, or the browser was installed to a cache directory that does not match where the launch looks at runtime.
What this error means
The launch throws "Could not find Chromium (rev. 1108766)" on older Puppeteer, or "Could not find expected browser (chrome) locally. Run npm install to download the correct Chromium revision" on newer versions.
Error: Could not find expected browser (chrome) locally. Expected to find the browser
at /home/runner/.cache/puppeteer/chrome/linux-124.0.6367.60/chrome-linux64/chrome
Run 'npm install' or 'npx puppeteer browsers install chrome' to download the browser.Common causes
The Chromium download was skipped at install
A PUPPETEER_SKIP_DOWNLOAD flag or a network failure during npm install left no browser on disk, so the launch has nothing to run.
The browser is in a different cache directory
The install wrote to one PUPPETEER_CACHE_DIR, but the launch resolves a different default path, so it reports the browser as missing.
How to fix it
Install the browser explicitly
- Ensure the download is not skipped for the install step.
- Run the Puppeteer browsers installer after
npm ci. - Confirm the launch uses the same cache directory the install wrote to.
npm ci
npx puppeteer browsers install chromePin one cache directory
Set PUPPETEER_CACHE_DIR at job level so install and launch resolve the same path.
env:
PUPPETEER_CACHE_DIR: ${{ github.workspace }}/.puppeteerHow to prevent it
- Run
npx puppeteer browsers install chromein CI after installing modules. - Set
PUPPETEER_CACHE_DIRconsistently across install, cache, and test steps. - Do not set skip-download unless you provide an external Chrome.