Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Node.js, PHP and APIs

ng serve cannot find the dev-server builder package

ErrorCould not find the implementation for builder @angular-devkit/build-angular:dev-server

Short answer

The builder named in angular.json (for example @angular-devkit/build-angular:dev-server) is looked up as an npm package starting from the workspace root. If that package is not in node_modules, the CLI cannot load it. Install the dependencies, or install the builder package that angular.json names.

  • Applies to Angular CLI 20, Angular CLI 21, Node.js 22, npm 10
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Read the builder name from angular.json, then ask npm whether that package is installed next to it.

    grep -n '"builder"' angular.json
    npm ls @angular/build @angular-devkit/build-angular
  2. 2Match what you see, then jump to its fix

    1. 1npm ls prints (empty) or the folder node_modules does not existnode_modules is missing or was never installedFix
    2. 2node_modules exists, but npm ls does not list the package named in the builder lineThe builder package named in angular.json is not a dependencyFix
    3. 3npm ls works in a parent or child folder but fails in the folder that holds angular.jsonnode_modules is in a different folder than angular.jsonFix

What does the error look like?

  • Could not find the implementation for builder @angular-devkit/build-angular:dev-server
  • Could not find the implementation for builder @angular/build:dev-server

Cause 1 of 3

node_modules is missing or was never installed

1Check

A fresh clone has no node_modules. The CLI resolves the builder package from the workspace root, so with no install there is nothing to find.

ls node_modules | head

2Fix

Install from package.json. Use npm ci when package-lock.json is committed and must not change.

npm install
# or, to follow the lockfile exactly
npm ci

3Verify

The package now shows in npm ls and the server starts.

npm ls @angular/build
ng serve

Confirmed by docs.npmjs.com

Did this fix it?

Cause 2 of 3

The builder package named in angular.json is not a dependency

1Check

A project created with a current CLI uses @angular/build; an older one uses @angular-devkit/build-angular. If you removed one package, or copied angular.json from another project, the names no longer match what package.json installs.

grep -n '"builder"' angular.json
grep -n 'build-angular\|@angular/build' package.json

2Fix

Install the package that angular.json names, as a dev dependency. To move an older project to the current builders, run the CLI's migration instead.

npm install --save-dev @angular/build
# to migrate from @angular-devkit/build-angular
ng update @angular/cli --name use-application-builder

3Verify

Run the dev server again and check that the build starts.

ng serve

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 3 of 3

node_modules is in a different folder than angular.json

1Check

The CLI starts searching at the workspace root, the folder with angular.json, and follows Node's normal module lookup upwards. Dependencies installed in a sibling or child folder are never seen.

ls angular.json package.json
npm ls @angular/build

2Fix

Run the install in the folder that holds both package.json and angular.json, and run ng from there.

cd path/to/workspace && npm install

3Verify

The listing shows the package, and ng serve starts.

npm ls @angular/build && ng serve

Confirmed by raw.githubusercontent.com

Did this fix it?

How do I stop it coming back?

  • Commit package-lock.json and install with npm ci in CI and on new machines.
  • Change builders in angular.json and the dependency in package.json in the same commit.
  • Keep package.json and angular.json in the same folder.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Back end

ng serve says it cannot determine the project or target

Cannot determine project for command.

The Angular CLI looked through angular.json for a project that defines the target you asked for (serve, build, test) and found none, or found several and could not pick one.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.