Puppeteer installed but cannot find its Chrome download
Could not find Chrome (ver. ...)Short answer
Puppeteer looks for its browser in a cache folder, ~/.cache/puppeteer by default. The error means that folder has no matching Chrome: the install script was blocked, the browser was never downloaded, or the app runs with another home directory or cache path than the install did. Install the browser again, or pin one cache folder.
Fix it fast
1Find out which cause you have
List the browsers Puppeteer has in its cache. An empty or missing folder points at the first cause.
ls ~/.cache/puppeteer2Match what you see, then jump to its fix
- 1
npm install finished with no download message, and the cache folder is emptyThe package manager blocked the install scriptFix - 2
It works in your shell and fails under a service, a container user or a deploy stepThe app runs as another user or with another home folder than the installFix - 3
Works after a local install, then fails on Google App Engine or Cloud FunctionsThe platform keeps node_modules between builds but not the cacheFix
- 1
What does the error look like?
Could not find Chrome (ver. ...)Could not find expected browser locally
Cause 1 of 3
The package manager blocked the install script
1Check
If your package manager blocks install scripts, the browser is not downloaded and the error follows.
ls ~/.cache/puppeteer/chrome 2>/dev/null || echo missing2Fix
Download the browser by hand, or allow the Puppeteer install script in package.json for npm.
npx puppeteer browsers install
# or allow the script in package.json
"allowScripts": { "puppeteer": true }3Verify
The cache folder now has a chrome entry.
ls ~/.cache/puppeteer/chromeConfirmed by pptr.dev
Cause 2 of 3
The app runs as another user or with another home folder than the install
1Check
Since version 19 Puppeteer keeps browsers in a cache under the home directory by default. Another user or home gets another, empty cache.
echo "$HOME"
ls "$HOME/.cache/puppeteer"2Fix
Pin the cache folder in .puppeteerrc.cjs inside the project, then reinstall so the browser lands there.
// .puppeteerrc.cjs
const { join } = require('path');
module.exports = {
cacheDirectory: join(__dirname, '.cache', 'puppeteer'),
};3Verify
Reinstall and check the project folder.
npm install puppeteer
ls .cache/puppeteerConfirmed by pptr.dev
Cause 3 of 3
The platform keeps node_modules between builds but not the cache
1Check
On those platforms the Puppeteer docs say only node_modules is cached between builds, so a browser in the default cache folder is gone at run time.
ls node_modules/.puppeteer_cache2Fix
Point the cache folder inside node_modules, as the troubleshooting guide shows, and reinstall.
// .puppeteerrc.cjs
const { join } = require('path');
module.exports = {
cacheDirectory: join(__dirname, 'node_modules', '.puppeteer_cache'),
};3Verify
Install again, then check that the browser sits under node_modules.
npm install && ls node_modules/.puppeteer_cacheConfirmed by pptr.dev
How do I stop it coming back?
- Run the browser install as part of the build, and fail the build if the cache folder is empty.
- Keep the cache folder in the project when the runtime user differs from the build user.
- Pin the Puppeteer version so the browser version it wants does not change under you.
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
Back end
Puppeteer cannot find the browser after deploying to Firebase Functions
Could not find Chromium
Puppeteer downloads Chrome to ~/.cache/puppeteer at install time.
3 causes, each with a fixBack end
Application Load Balancer returns 502 for a Node.js target
HTTPCode_ELB_502_Count
An ALB returns 502 when the target gives it something it cannot use: a refused or reset connection, a connection closed mid-request, a bad response, or a header over 32 K.
4 causes, each with a fixBack end
corepack enable fails: permission denied while creating the pnpm link
Internal Error: EACCES: permission denied, symlink '../lib/node_modules/corepack/dist/pnpm.js' -> '/usr/local/bin/pnpm'
corepack enable writes small link files for yarn and pnpm next to your node binary.
2 causes, each with a fixBack end
Create React App says Node is too old, and npm will not run on the new one
npm does not support Node.js v10.19.0
The shell is running an old Node.js that is below the version Create React App needs.
3 causes, each with a fixBack end
firebase deploy cannot load your functions: user code failed to load
Functions codebase could not be analyzed successfully. It may have a syntax or runtime error
The Firebase CLI loads your functions code on your machine before it deploys, to learn which functions exist.
4 causes, each with a fixBack end
firebase deploy stops because the predeploy lint step failed
Error: There was an error deploying functions
The predeploy hook in firebase.json runs npm run lint before every deploy, and a failing hook cancels the deploy.
3 causes, each with a fix