User Agents

Web browsers and everyday web tech, explained

Fix Puppeteer Could Not Find Chrome Errors

· 5 min read · Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

When Puppeteer throws an error like "Could not find Chrome (ver. X)" or "Failed to launch the browser process", it usually means the browser binary is missing, not installed, or not where Puppeteer expects it. This guide walks through the most reliable fixes, from automatic installation to manual paths and environment variables.

What You'll Need

  • A Node.js project with Puppeteer installed (npm install puppeteer)
  • Terminal or command-line access
  • Basic understanding of environment variables

Step-by-Step

  1. Identify the exact error message. Run your script and note the full error. Common variants include:
    • "Could not find Chrome (ver. 123.0.0.0)" – Puppeteer expects a specific version.
    • "Failed to launch the browser process" – Chrome exists but can't start.
    • "The executable path is not a file" – The path you gave is wrong.
  2. Install the browser that Puppeteer expects. The simplest fix is to run:
    npx puppeteer browsers install chrome
    This downloads the exact Chromium version Puppeteer needs into its cache. If you're using Puppeteer v22+, the command is the same; for older versions, you might use node node_modules/puppeteer/install.js.
  3. Check if Chrome is installed system-wide. If you prefer to use your existing Chrome/Chromium, find its path:
    • Windows: C:\Program Files\Google\Chrome\Application\chrome.exe or C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
    • macOS: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    • Linux: /usr/bin/google-chrome or /usr/bin/chromium-browser
    Then pass it to Puppeteer in your script:
    const browser = await puppeteer.launch({ executablePath: '/path/to/chrome' });
  4. Set the executablePath globally via environment variable. Instead of editing every script, set PUPPETEER_EXECUTABLE_PATH to your Chrome path. Example on Linux/macOS:
    export PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome
    On Windows (PowerShell):
    $env:PUPPETEER_EXECUTABLE_PATH="C:\Program Files\Google\Chrome\Application\chrome.exe"
    Puppeteer will pick this up automatically.
  5. If you're using Puppeteer in a CI/CD environment (like GitHub Actions), install Chrome explicitly. For Ubuntu, add a step:
    sudo apt-get update && sudo apt-get install -y google-chrome-stable
    Then set the executable path or let Puppeteer use its own downloaded Chrome (which is often more reliable).
  6. For Puppeteer v22 and later, check the cache location. The browser is stored in ~/.cache/puppeteer (Linux/macOS) or %USERPROFILE%\.cache\puppeteer (Windows). If you cleared this folder, re-run the install command from step 2.
  7. If you're using puppeteer-core, remember it does not download a browser. You must provide an executablePath or have Chrome installed. Install puppeteer (not puppeteer-core) if you want automatic downloads.

Common Mistakes

  • Using puppeteer-core without a browser. Puppeteer-core is a library only; it expects you to supply a browser. If you don't need the extra features, switch to the full puppeteer package.
  • Setting executablePath to a .app folder on macOS. You must point to the actual binary inside the .app, not the .app directory itself.
  • Forgetting to reinstall after deleting node_modules. The browser cache is separate, but if you run npm install again, Puppeteer will check and download if needed. If you deleted the cache manually, run the install command again.
  • Using a wrong path with spaces. Always quote paths in code and environment variables.

Tips

  • Use the bundled Chrome for consistency. Let Puppeteer download its own Chromium – it's tested with that exact version. Avoid system Chrome unless you have a reason.
  • Pin your Puppeteer version. If you're working in a team, specify the exact version in package.json to avoid surprises when a new version expects a different Chrome build.
  • Set PUPPETEER_SKIP_DOWNLOAD=false (default) to ensure the browser is downloaded during npm install. If you set it to true earlier, unset it.
  • Use a .env file to store the executable path if you switch between environments.

Troubleshooting

Error persists after install? Verify the downloaded Chrome exists by running npx puppeteer browsers list (or check the cache folder). If it's there, try launching it manually with ./chrome --version to see if it runs.

Chrome launches but crashes immediately? This often happens on Linux servers without required libraries. Install dependencies with:

sudo apt-get install -y libnss3 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libgbm1 libasound2

Permission errors? On Linux, if Chrome is in a restricted location, run your script with a user that has execute permissions. In Docker, ensure you're not running as root unnecessarily – Chrome may refuse to run as root without --no-sandbox.

Still not working? Try running with --no-sandbox in launch options if you're in a container or as root (but be cautious about security).

Check the headless mode. Some versions of Chrome require headless: 'new' in Puppeteer options. If you see a message about headless, try:

await puppeteer.launch({ headless: 'new' });

Frequently Asked Questions

Why does Puppeteer say "Could not find Chrome" even though I have Chrome installed?

Puppeteer looks for a specific version of Chromium that matches its internal version. Your system Chrome might be a different version. Use the executablePath option to point to your Chrome, or run npx puppeteer browsers install chrome to get the exact one.

What's the difference between puppeteer and puppeteer-core?

Puppeteer automatically downloads a compatible Chrome browser during installation. Puppeteer-core does not – you must provide a browser yourself, either via executablePath or a system Chrome.

How do I fix this in a Docker container?

In your Dockerfile, install Chrome manually (e.g., apt-get install google-chrome-stable) or run npx puppeteer browsers install chrome after npm install. Also install the required system libraries as mentioned in Troubleshooting.

Can I use Puppeteer with Firefox or other browsers?

Yes, Puppeteer supports Firefox experimentally. For Chrome errors, you can also try puppeteer.launch({ product: 'firefox' }) if you have Firefox installed, but the error specifically refers to Chrome.

Why does it work locally but fail on a server?

Servers often lack the GUI libraries Chrome needs. Install the dependencies listed in Troubleshooting, and ensure you have write permissions to the cache folder where Puppeteer stores the browser.

How do I clear the Puppeteer cache and re-download Chrome?

Delete the cache folder (~/.cache/puppeteer on Linux/macOS, %USERPROFILE%\.cache\puppeteer on Windows) and then run npx puppeteer browsers install chrome.