Fix Cypress Chrome Browser Not Available
In this article
When Cypress reports "Chrome browser not available," it usually means Cypress cannot find a Chrome installation on your system or the browser binary path is misconfigured. This guide walks you through verifying Chrome is installed, checking Cypress's browser detection, and configuring Cypress to use the correct Chrome executable. You'll need access to your terminal, Cypress project files, and permission to install or modify browser settings.
What You'll Need
- A terminal or command prompt
- Access to your project's Cypress configuration file (cypress.config.js or cypress.json)
- Chrome or a Chromium-based browser installed (or the ability to install one)
- Administrator rights if installing Chrome or modifying system paths
Step-by-Step
- Verify Chrome is installed. On Windows, check for Chrome in "C:\Program Files\Google\Chrome\Application\chrome.exe" or "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe". On macOS, look in "/Applications/Google Chrome.app". On Linux, run
which google-chromeorwhich chromium-browserin the terminal. If Chrome is missing, download and install it from Google's official site. - Check Cypress's detected browsers. Run
npx cypress openin your project root. In the Cypress launcher, click the dropdown next to the browser selection. If Chrome appears, select it and proceed. If it doesn't, close Cypress and continue to the next step. - Run Cypress in debug mode to see browser detection logs. Execute
DEBUG=cypress:launcher npx cypress open(on Windows, useset DEBUG=cypress:launcher && npx cypress open). Look for lines mentioning Chrome or Chromium. This shows which paths Cypress is checking. - Manually specify the Chrome executable path in Cypress config. Open your
cypress.config.js(orcypress.jsonfor older versions). Add ae2eblock withtestFilesandchromeWebSecurityas needed, but crucially add alaunchOptionsor use thebrowsersarray. For example:module.exports = defineConfig({ e2e: { setupNodeEvents(on, config) { on('before:browser:launch', (browser, launchOptions) => { if (browser.name === 'chrome') { launchOptions.executablePath = '/path/to/chrome'; } return launchOptions; }); }, }, });Replace/path/to/chromewith the actual path from step 1. - Alternatively, use the
browsersconfig array. In your Cypress config, add abrowsersarray specifying the Chrome executable. For example:module.exports = defineConfig({ e2e: { browsers: [{ name: 'chrome', family: 'chromium', displayName: 'Chrome', version: 'stable', path: '/path/to/chrome', majorVersion: 120, }], }, });This forces Cypress to use that exact binary. - Set the CHROME_BIN environment variable. Before running Cypress, set the environment variable to the Chrome executable path. On macOS/Linux:
export CHROME_BIN="/path/to/chrome". On Windows PowerShell:$env:CHROME_BIN="C:\path\to\chrome.exe". Then run Cypress again. - Reinstall Cypress. Sometimes Cypress's browser detection fails due to a corrupted cache. Run
npx cypress cache clearand thennpx cypress installto re-download the Cypress binary. - Check for Chrome updates. An outdated Chrome version might not be recognized. Update Chrome to the latest stable release, then restart your computer and try Cypress again.
Common Mistakes
- Using the wrong path: On macOS, the executable is inside the .app bundle, not the .app folder itself. The correct path is "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome".
- Forgetting to restart Cypress after changing config: Cypress reads the config at startup, so you must fully close and reopen it.
- Setting the environment variable only in the current terminal session: If you open a new terminal, the variable is lost. Set it in your shell profile or use a .env file.
- Assuming Chrome is installed when it's actually Chromium: Cypress can detect Chromium, but the browser name might be "chromium" not "chrome". Use the correct name in config.
- Editing the wrong config file: Cypress 10+ uses
cypress.config.js, while older versions usecypress.json. Check your project structure.
Tips
- Use the
npx cypress verifycommand to check if Cypress can launch browsers. It will list detected browsers and their paths. - If you use a Chromium-based browser like Brave or Edge, you can point Cypress to that executable instead of Chrome. The browser name should be 'chrome' or 'chromium' depending on the family.
- Keep your Chrome installation in a standard location to avoid manual path configuration.
- When using CI, set the CHROME_BIN environment variable in your CI pipeline configuration to ensure consistency.
- Consider using
cypress run --browser chrometo force Chrome usage in headless mode.
Troubleshooting
If the steps above don't resolve the issue, try the following:
- Check Cypress logs: Run with
DEBUG=cypress:*to see detailed logs. Look for any errors about browser detection. - Test the executable path manually: In your terminal, run
"/path/to/chrome" --versionto verify the path is correct and the binary is executable. - Check file permissions: On Linux/macOS, ensure the Chrome binary has execute permissions:
chmod +x /path/to/chrome. - Remove any custom browser config: If you added a
browsersarray earlier, remove it and try the default detection again to isolate the problem. - Try a different browser: If Chrome is still not detected, try Firefox or Edge to see if Cypress works with any browser. This tells you whether the issue is specific to Chrome or general.
- Check for proxy or network issues: Cypress might be trying to download Chrome driver or dependencies. Ensure your network allows access to Google's servers.
Frequently Asked Questions
Why does Cypress say "Chrome browser not available" even though I have Chrome installed?
This usually happens because Cypress cannot find the Chrome executable in standard locations or the path is not in your system's PATH variable. Use the steps above to manually specify the path.
Can I use Chromium instead of Chrome?
Yes, Cypress supports Chromium-based browsers. In the config, set the browser name to 'chromium' and provide the path to the Chromium executable.
Do I need to install Chrome separately for Cypress?
Yes, Cypress does not bundle Chrome. You must have a Chrome or Chromium browser installed on your system.
How do I set the Chrome path permanently on Windows?
Set the CHROME_BIN environment variable via System Properties > Environment Variables, or add the Chrome directory to your PATH. Then restart your terminal.
What if I'm using a portable Chrome installation?
Portable Chrome may not be registered in the system. You'll need to manually specify the path in Cypress config or set CHROME_BIN.
Does this issue affect Cypress in Docker containers?
Yes, in Docker you need to install Chrome inside the container or mount a Chrome installation. Use the official cypress/browsers images which include Chrome.