Skip to content
Latchkey

Angular "Cannot find module '@angular-devkit/build-angular'" in CI

The builder named in angular.json (@angular-devkit/build-angular) is not in node_modules, so ng build cannot load it. It is a devDependency, so the usual cause is a pruned or incomplete install.

What this error means

ng build or ng test fails immediately with "Cannot find module '@angular-devkit/build-angular'" or "Could not find the implementation for builder".

ng
An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'
Require stack:
- /home/runner/work/app/app/node_modules/@angular/cli/...

Common causes

Dev dependencies were not installed

@angular-devkit/build-angular is a devDependency; a production-only install (--omit=dev) removes it, so the builder cannot be found.

The package is missing from package.json

A partial or hand-edited package.json no longer lists the builder, so a clean install does not provide it.

How to fix it

Run a full install before building

  1. Use npm ci so devDependencies are installed.
  2. Confirm @angular-devkit/build-angular is listed in package.json.
  3. Re-run ng build.
.github/workflows/ci.yml
- run: npm ci
- run: npx ng build

Reinstall the builder if it is missing

Add the builder package at a version matching your Angular major.

Terminal
npm install -D @angular-devkit/build-angular

How to prevent it

  • Keep a full npm ci in the build job, not a production-only install.
  • Ensure the builder version matches your Angular major.
  • Commit the lockfile so the builder resolves identically in CI.

Related guides

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