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
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
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> .
Syntax. ng update command updates the application and its dependencies.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With