ng update to specific Angular version

Adding this here, since this comes up in search results and the answers provided here didn't work for me.

What worked for me was using ng update @angular/[email protected]. This should probably be noted in the Angular Update Guide (https://update.angular.io/), but it's not. Since that page throws a notice up when upgrading across more than one major version at a time, but using the recommended command ng update @angular/core upgrades to the latest release (which could be across more than one major version), perhaps this should be changed.


You can use the @ symbol to specify the version on each package desired. The currently recommend approach to upgrading Angular to a newer version (or version you dictate) is to use the following command:

ng update @angular/cli @angular/core

In this case let's say I wanted to upgrade to 8.1.1 instead of the latest version of 8.2.0 I would use the following:

ng update @angular/[email protected] @angular/[email protected]

This is the same way you specify a specific version when doing any npm installs as explained here.


According to the documentation you will need to define a From..

--to=to     

Version up to which to apply migrations. Only available with a single package being updated, and only on migrations only. Requires from to be specified. Default to the installed version detected.

Tags:

Angular