I am trying to upgrade an Angular 7 application to Angular 8 using instructions from here. Everything went well until the last step:
ng update @angular/material
This updated Angular Material packages to 8.1.2, but also upgraded @angular/* packages to a rather strange an undesired version: ~9.0.0-next.0
This is problematic (I had to get rid of a non-essential dev dependency that requires Angular <= 8) as I do not want to go beyond version 8 which is the latest stable one.
How should I tackle this?
The problem is that before running a ng update @angular/material
some of your dependencies were already on 8.2.0
while @angular/material
was still on version 7.
ng update @angular/material
apparently only checks if there is update available for @angular/material
- not for other dependencies that it might update on the way. So when you launched the command, it noticed that there was a newer version available and it proceeded with updating. Other dependencies got updated as well as they were on a version 8 before doing an update (and there was version 9 available).
This is why you always have to keep an eye that all your versions are aligned before doing an update.
And just a small observation: The 9.0.0-next.0
was released just an hour before you did the update. So if you did it before that, you wouldn't have any of these problems.
The possible fix for this is to manually edit the package.json
and change the dependencies with version ^9.0.0-next.0
to ^8.2.0
The community seems to think this is a bug. See: https://github.com/angular/angular-cli/issues/14980 (scroll down).
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