2

While updating to Angular 9 I am getting below errors.

Package "@ionic/angular" has an incompatible peer dependency to "@angular-devkit/core" (requires "7.2.1 - 8", would install "9.0.1").                                   
Package "@ionic/angular" has an incompatible peer dependency to "@angular-devkit/schematics" (requires "7.2.1 - 8", would install "9.0.1").           

Incompatible peer dependencies found.                                                                                                                                   
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.                                                  
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.

Updating with force is proper way or should I wait for it. My ionic/angular version is as below.

"@ionic/angular": "^4.7.1",
Shabbir Dhangot
  • 8,954
  • 10
  • 58
  • 80

1 Answers1

3

Although running the following commands will upgrade you to Ionic 5 + Angular 9 (without the npm warning that you are getting):

npm install @ionic/angular@latest @ionic/angular-toolkit@latest

Next, run the following command. Like @Tinaira mentioned (in the comment), commit/stash any changes before running this command.

ng update @angular/core @angular/cli

(Or pass --allow-dirty to the end of the command if you don't want to commit/stash your changes - NOT RECOMMENDED).

But later on, you might also face another issue of JIT compilation. Check this out Ionic 5 with Angular 9 - Angular JIT compilation failed: '@angular/compiler' not loaded

Shashank Agrawal
  • 25,161
  • 11
  • 89
  • 121
  • 1
    about the second command. I have to add that if there comes an error "Repository is not clean. Please commit or stash any changes before updating." to just add --allow-dirty at the end of the command: ng update @angular/cli @angular/core --allow-dirty – Tinaira Mar 19 '20 at 00:24