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

  1. Run 'npm install' (or your package manager) in the project root
  2. Check angular.json 'builder' strings for typos and confirm the package is in package.json dependencies/devDependencies
  3. Install the specific builder package, e.g. 'npm i -D @angular-devkit/build-angular'
  4. 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

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


AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30). Data as JSON: /api/errors/f46ee2ea7de51e11. Report an issue: GitHub.