angularnpmangular-cling-build

Ng build angular cli and angular compatibility issues


When I run ng build I get this error

This version of CLI is only compatible with Angular versions ^13.0.0 || ^13.3.0-rc.0, but Angular version 18.2.10 was found instead.

These are my current versions

Angular CLI: 18.2.11
Node: 22.11.0
Package Manager: npm 10.9.0
OS: darwin arm64

Angular: 18.2.10
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1303.11
@angular-devkit/build-angular   18.2.11
@angular-devkit/core            13.3.11
@angular-devkit/schematics      18.2.11
@angular/cdk                    18.2.11
@angular/cli                    18.2.11
@angular/material               18.2.11
@schematics/angular             18.2.11
rxjs                            7.5.7
typescript                      5.5.4
webpack                         5.95.0
zone.js                         0.14.10

Solution

  • If you use @angular-builders/custom-webpack

    Upgrade the version in the package.json file. In my case, even though I used ng update to upgrade angular core and cli from 13 - 18 @angular-builders/custom-webpack is not included in that update.