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
- Add a
ChromeHeadlessCIlauncher with--no-sandboxand--headless. - Run
ng testagainst it in single-run mode without watch. - Re-run the job.
Terminal
ng test --watch=false --browsers=ChromeHeadlessInstall 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_ENVHow to prevent it
- Provision a headless Chrome in the test job and set
CHROME_BIN. - Use
--no-sandboxheadless flags suited to CI containers. - Run tests with
--watch=falseso the job exits cleanly.
Related guides
Angular "ENOSPC: System limit for number of file watchers reached" in CIFix Angular "ENOSPC: System limit for number of file watchers reached" in CI - the dev server or watch build…
Angular "Cannot find module '@angular-devkit/build-angular'" in CIFix Angular "Cannot find module '@angular-devkit/build-angular'" in CI - the builder package referenced by an…
Angular "NullInjectorError: No provider for X" in CIFix Angular "NullInjectorError: No provider for X" in CI - a service requested by DI was never provided, so u…