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",
2
  • ionic 5 has been released. You could try that Commented Feb 12, 2020 at 5:57
  • Yes I know, I thought I am using ionic 5 only. While checking npm outdated I come to know. Commented Feb 12, 2020 at 7:18

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.