Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng update to specific version

Tags:

angular

I would like to update Angular from version 5.0 to version 6.1. The instructions at https://update.angular.io/ suggest using ng update @angular/core to update. However this updates directly to version 7 instead of version 6.

The ng update docs suggest that using --to would update to a specific version. However this does not seem to work. The exact command used is: ng update @angular/core --to 6.1.0 But this updates to 7.0.0

EDIT:

I've tried using --from=5.0.0 --to=6.1.9 but this didn't work. I've noticed we're stil using angular-cli version 1.6.4. This version supports --next which according to the docs should (Default: false) Install the next version, instead of the latest. However this changes the package.json to use version 7.0.0 of all @angular/* packages

like image 574
Jaap Avatar asked Oct 24 '18 13:10

Jaap


People also ask

How do I upgrade ng to a specific version?

ng updatelink To update to the next beta or pre-release version, use the --next=true option. To update from one major version to another, use the format ng update @angular/cli@^<major_version> @angular/core@^<major_version> .

What does ng update do?

Syntax. ng update command updates the application and its dependencies.


1 Answers

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.

like image 68
Alan Valkoun Avatar answered Oct 04 '22 08:10

Alan Valkoun