Home > Back-end >  Having difficulty upgrading from Ionic 5 to Ionic 6 (dependency issues) [angular]
Having difficulty upgrading from Ionic 5 to Ionic 6 (dependency issues) [angular]

Time:10-14

When I try to update to Ionic 6 using the command:

npm install @ionic/angular@6

I get this:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/core
npm ERR!   @angular/core@"~8.1.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@">=12.0.0" from @ionic/[email protected]
npm ERR! node_modules/@ionic/angular
npm ERR!   @ionic/angular@"6" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /x/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /x/.npm/_logs/2022-10-11T23_20_13_132Z-debug.log

Which means my angular core is out of date, so I try to update my angular core using this command:

npm i @angular/core@"~12.x.x"

I get

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/zone.js
npm ERR!   zone.js@"~0.9.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer zone.js@"~0.11.4" from @angular/[email protected]
npm ERR! node_modules/@angular/core
npm ERR!   @angular/core@"~12.x.x" from the root project

What am I doing wrong? How can I fix this?

Any help would be appreciated.

CodePudding user response:

As per your question yesterday, the answer is to carefully follow the steps for upgrading from 8.1 to 12.

CodePudding user response:

You need to follow the angular update guide. https://ionicframework.com/docs/intro/upgrading-to-ionic-6

  • Related