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".
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
- Use
npm ciso devDependencies are installed. - Confirm
@angular-devkit/build-angularis listed in package.json. - Re-run
ng build.
- run: npm ci
- run: npx ng buildReinstall the builder if it is missing
Add the builder package at a version matching your Angular major.
npm install -D @angular-devkit/build-angularHow to prevent it
- Keep a full
npm ciin 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.