angular/angular-cli · error · CommandModuleError
Could not find the '${builderConf}' builder's node package.
Error message
Could not find the '${builderConf}' builder's node package. What it means
When resolving an architect target's builder (e.g. @angular-devkit/build-angular:browser), the CLI loads the builder's node package. If resolution fails with MODULE_NOT_FOUND, it converts the error into a CommandModuleError saying the builder's node package could not be found.
Source
Thrown at packages/angular/cli/src/command-builder/architect-base-command-module.ts:193
protected async getArchitectTargetOptions(target: Target): Promise<Option[]> {
const architectHost = this.getArchitectHost();
let builderConf: string;
try {
builderConf = await architectHost.getBuilderNameForTarget(target);
} catch {
return [];
}
let builderDesc: NodeModulesBuilderInfo;
try {
builderDesc = await architectHost.resolveBuilder(builderConf);
} catch (e) {
assertIsError(e);
if (e.code === 'MODULE_NOT_FOUND') {
this.warnOnMissingNodeModules();
throw new CommandModuleError(`Could not find the '${builderConf}' builder's node package.`);
}
throw e;
}
return parseJsonSchemaToOptions(
new json.schema.CoreSchemaRegistry(),
builderDesc.optionSchema as json.JsonObject,
true,
);
}
private warnOnMissingNodeModules(): void {
const basePath = this.context.workspace?.basePath;
if (!basePath) {
return;
}
View on GitHub (pinned to bb72145f9a)
Solutions
- Run 'npm install' (or your package manager) in the project root
- Check angular.json 'builder' strings for typos and confirm the package is in package.json dependencies/devDependencies
- Install the specific builder package, e.g. 'npm i -D @angular-devkit/build-angular'
- Delete node_modules and the lockfile and reinstall if resolution is corrupted
Example fix
// before (angular.json) "builder": "@angular-devkit/build-anguler:browser" // after "builder": "@angular-devkit/build-angular:browser" // and: npm i -D @angular-devkit/build-angular
Defensive patterns
Strategy: validation
Validate before calling
import { resolveSync } from 'resolve';
const builderPkg = 'angular.json' && getBuilderPackage('angular.json', 'app:build');
if (!resolveSync(builderPkg, { basedir: process.cwd() })) {
throw new Error(`${builderPkg} not installed; run npm install`);
} Try / catch
try {
await runNgCommand('build');
} catch (e) {
if (String(e.message).includes("builder's node package")) {
execSync('npm install', { stdio: 'inherit' });
} else throw e;
} Prevention
- Always npm install after cloning or switching branches
- Keep all builders used in angular.json listed in package.json
- Beware package renames in Angular version migrations and run 'ng update' migrations
- Use a lockfile so CI installs the same builder packages
When it happens
Trigger: angular.json references a builder package that is not installed (missing from node_modules), a typo in the builder package name, using a custom/community builder without npm install, or node_modules pruned/corrupted.
Common situations: Fresh clone without 'npm install'; switching branches that added a new builder dependency; pnpm/yarn workspaces hoisting issues; package renamed in a CLI major upgrade (e.g. @angular-devkit/build-angular migration).
Related errors
- Cannot find "${this.getArchitectTarget()}" target for the sp
- Cannot determine project for command. This is a multi-projec
- An unexpected error happened; could not determine version fo
- Project "${project}" does not exist.
- Project target does not exist.
AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30).
Data as JSON: /api/errors/f46ee2ea7de51e11.
Report an issue: GitHub.