'How do you know what package version you need in angular?

I had an asp.net core app on Angular 10.2.4, decided to upgrade to 11. Ran: ng update @angular/core@11 @angular/cli@11 it failed complaining of devkit. Uninstalled devkit, upgraded angular to 11.2.14 OK.

Now am trying to install devkit back.

  • npm install @angular-devkit/build-angular --save-dev - fail - seems try to install v12 and depends on cli 12 also.

  • npm install @angular-devkit/[email protected] --save-dev or npm install @angular-devkit/build-angular@11 --save-dev - fail - No matching version found for @angular-devkit/build-angular@xx

What's the right version of devkit for Angular 11? What's the general idea on how to find/infer/guess correct version of a package for a certain Angular version?



Solution 1:[1]

I go here (https://www.npmjs.com/package/@angular-devkit/build-angular) and I click on the versions tab. It seems with version 12 they have become semantic (meaning 12.0.2 matches with Angular 12) but for you I think you need version 0.1102.13. You can check out all the versions on that site.

Solution 2:[2]

On the right side of the site

https://www.npmjs.com/package/@angular-devkit/build-angular

It has the TAG referring to the angular version

Example: 12.2.17--------81.826------v12-lts 0.1102.19------36.756------v11-lts

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AliF50
Solution 2 Jordao_bass