angularnpmangular-cli

Error: Could not find the '@angular-devkit/build-angular:dev-server' builder's node package


While running angular project first time using ng serve this thorws the error.

Error: Could not find the '@angular-devkit/build-angular:dev-server' builder's node package.

{
  "name": "school-mgt",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/cdk": "^19.2.15",
    "@angular/common": "^19.2.0",
    "@angular/compiler": "^19.2.0",
    "@angular/core": "^19.2.0",
    "@angular/forms": "^19.2.0",
    "@angular/material": "^19.2.15",
    "@angular/platform-browser": "^19.2.0",
    "@angular/platform-browser-dynamic": "^19.2.0",
    "@angular/router": "^19.2.0",
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.15.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^19.2.11",
    "@angular/cli": "^19.2.11",
    "@angular/compiler-cli": "^19.2.0",
    "@types/jasmine": "~5.1.0",
    "jasmine-core": "~5.6.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "typescript": "~5.6"
  }
}


Solution

  • This issue is occurring due to forgetting some basic checks while installing project dependencies. In my case the main issue was that the TypeScript version did not match the latest version of Angular [19].

    Updated following thisngs to run my project.

    Update angular/cli from 16 to 19.

    Update angular/devkit to 19.

    Update Typescript 2 to 5.6.

    Before run project check all the version install on your device. if any mistmatch version can caues this issue