Skip to content
Latchkey

Angular "ng test" Chrome not found (Karma headless) in CI

Angular's default test runner, Karma, launches Chrome to run unit tests. On a headless CI runner with no Chrome installed (or no CHROME_BIN), Karma cannot start the browser and the test job fails.

What this error means

ng test fails with "No binary for ChromeHeadless browser on your platform" or "Cannot start ChromeHeadless", before any spec runs.

ng
30 06 2026 10:00:00.000:ERROR [launcher]: No binary for ChromeHeadless browser on your platform.
  Please, set "CHROME_BIN" env variable.

Common causes

No Chrome installed on the runner

A slim runner image has no Chrome, so Karma's Chrome launcher has nothing to start.

CHROME_BIN not pointing at a browser

Chrome exists but CHROME_BIN is unset or points to a missing path, so the launcher cannot find it.

How to fix it

Run a true headless Chrome with the right flags

  1. Add a ChromeHeadlessCI launcher with --no-sandbox and --headless.
  2. Run ng test against it in single-run mode without watch.
  3. Re-run the job.
Terminal
ng test --watch=false --browsers=ChromeHeadless

Install Chrome and set CHROME_BIN

Provision Chrome on the runner and point CHROME_BIN at it.

.github/workflows/ci.yml
- uses: browser-actions/setup-chrome@v1
- run: echo "CHROME_BIN=$(which chrome)" >> $GITHUB_ENV

How to prevent it

  • Provision a headless Chrome in the test job and set CHROME_BIN.
  • Use --no-sandbox headless flags suited to CI containers.
  • Run tests with --watch=false so the job exits cleanly.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →