ERESOLVE unable to resolve dependency tree with angular-toolkit on Ionic 5

Hello,

I am having a problem that I cannot understand how it came… I am deploying an iOS app for the first time but was working perfect for android, It gives this error when I execute `npm i @ionic/angular-toolkit@latest’:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: xstories@1.2.0
npm ERR! Found: typescript@4.1.5
npm ERR! node_modules/typescript
npm ERR!   peer typescript@">=4.0 <4.2" from @angular/compiler-cli@11.2.0
npm ERR!   node_modules/@angular/compiler-cli
npm ERR!     peer @angular/compiler-cli@"^11.0.0" from @angular-devkit/build-angular@0.1100.7
npm ERR!     node_modules/@angular-devkit/build-angular
npm ERR!       peer @angular-devkit/build-angular@"^0.1100.0" from @ionic/angular-toolkit@3.0.0
npm ERR!       node_modules/@ionic/angular-toolkit
npm ERR!         @ionic/angular-toolkit@"3.0.0" from the root project
npm ERR!     peer @angular/compiler-cli@"11.2.0" from @angular/localize@11.2.0
npm ERR!     node_modules/@angular/localize
npm ERR!       peerOptional @angular/localize@"^11.0.0" from @angular-devkit/build-angular@0.1100.7
npm ERR!       node_modules/@angular-devkit/build-angular
npm ERR!         peer @angular-devkit/build-angular@"^0.1100.0" from @ionic/angular-toolkit@3.0.0
npm ERR!         node_modules/@ionic/angular-toolkit
npm ERR!     1 more (ng-packagr)
npm ERR!   peer typescript@">=4.0 <4.2" from ng-packagr@11.2.1
npm ERR!   node_modules/ng-packagr
npm ERR!     peerOptional ng-packagr@"^11.0.0" from @angular-devkit/build-angular@0.1100.7
npm ERR!     node_modules/@angular-devkit/build-angular
npm ERR!       peer @angular-devkit/build-angular@"^0.1100.0" from @ionic/angular-toolkit@3.0.0
npm ERR!       node_modules/@ionic/angular-toolkit
npm ERR!         @ionic/angular-toolkit@"3.0.0" from the root project
npm ERR!   1 more (tslint)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer typescript@"~4.0.0" from @angular-devkit/build-angular@0.1100.7
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR!   peer @angular-devkit/build-angular@"^0.1100.0" from @ionic/angular-toolkit@3.0.0
npm ERR!   node_modules/@ionic/angular-toolkit
npm ERR!     @ionic/angular-toolkit@"3.0.0" 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.

How to solve it? cannot get rid of Typescript 4.1.5, VSCode always found it. I want to use 3.9.5 for all the apps

Thank you

Hi @Manel00,

I think this may due to the Angular version of your app.
As mentioned in @ionic/angular-toolkit V3.0.0 release note here

Users are required to update to 11.0.0 of Angular/Angular CLI in order to use this

Maybe you should use an older version of @ionic/angular-toolkit.

v2.3.3 seems to be the latest version compatible with Angular’s versions prior to 11.

You can run npm install --legacy-peer-deps or downgrade npm to 6 as this problem is caused by npm 7

I did it @jcesarmobile but didn’t work…

@GThireau1 At the end I had to update at this version, thank you!