Search code examples
angular-cliversionangular14downgrade

Angular 14 CLI is not compatible with node version 18.12.1


Angular 15 CLI is compatible with node version 18.12.1. But after downgrading to Angular CLI 14 the existing node version is unsupported. I'm finding the maximum node version which is compatible with Angular 14 CLI.

enter image description here


Solution

  • I suggest to make a clear distinction between "being compatible" vs. "being supported".

    Node.js versions that are compatible with a particular Angular version

    If a Node.js version is compatible with a particular Angular version, it means you can use both at the same time, but they have not necessarily been tested in combination.

    E.g. package.json of @angular/cli 14.0.0 reveals that this version is compatible to all minor and patch versions of Node.js 14 (14.x.x) as well as all versions equal or greater than Node 16.10.0 (even the latest 19.x.x):

    "node": "^14.15.0 || >=16.10.0",

    Hint: You can find the info above under https://www.npmjs.com/package/@angular, when go to the "Versions" tab, choose the version you are interested in and then go back to the "Code"-tab, where you open package.json.

    Node.js versions that are supported by a particular Angular version

    If a Node.js version is (officially) supported by a particular Angular version, it means the Angular developers have tested them in combination and they will provide support if the combination causes any issues (the latter will not be the case if only "compatibility" is given). So being "supported" is a much stricter criterion than just being "compatible".

    E.g. @angular/cli 15.0.0 supports all patch-versions of Node.js 18.10 (18.10.x). This makes sense since Node.js 18.10.0 was released shortly before Angular 15.

    Hint: You can find the supported Node.js-versions in the official update-documentation of Angular. E.g. for Angular 15: https://angular.io/guide/update-to-version-15

    Conclusion

    The thread title should actually read "Why is node version 18.12.1 not supported by Angular CLI 14". Compatibility, on the other hand, will be fulfilled by any future Node.js version, since Angular CLI 14 states: >=16.10.0. It is even likely that Angular 14 CLI works smoothly with "Node.js 18.12.1". At least in my own tests there have been no problems so far.