3

I am trying to upgrade my angular cli and angular core from 12 to 13, but looks like there are peer dependency issues. did any one faced this issue ?

npx @angular/cli@13 update @angular/core@13 @angular/cli@13

[![npm ERR! Could not resolve dependency:
npm ERR! dev @angular/compiler-cli@"~13.0.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: typescript@4.4.4
npm ERR! node_modules/typescript
npm ERR!   peer typescript@">=4.4.2 <4.5" from @angular/compiler-cli@13.0.0
npm ERR!   node_modules/@angular/compiler-cli
npm ERR!     dev @angular/compiler-cli@"~13.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.][1]][1]
 

logs

Ravikumar
  • 413
  • 1
  • 7
  • 18
  • 1
    Have you tried running the command with `--force`? See this GitHub issue: https://github.com/angular/angular-cli/issues/21204 – JSON Derulo Nov 10 '21 at 13:17
  • thanks, it's working but "-- force" wouldn't be problem ? – Ravikumar Nov 10 '21 at 15:01
  • from [documentation](https://angular.io/cli/update#options): "Ignore peer dependency version mismatches. Passes the --force flag to the package manager when installing packages." So I don't think it's a problem – JSON Derulo Nov 10 '21 at 17:36

1 Answers1

4

I had the same issue whenever I upgraded my Angular app to higher version. I always used --force command, and upgrade finished successfully. So just add --force command, and be sure to test you app after the upgrade.

npx @angular/cli@13 update @angular/core@13 @angular/cli@13 --force

Also, do the same thing if you upgrading Material:

npx @angular/cli@13 update @angular/material@13 --force
NeNaD
  • 18,172
  • 8
  • 47
  • 89
  • I developed a VS Code extension (Angular Evergreen) to help out with the Angular upgrade process, you can check it out at https://marketplace.visualstudio.com/items?itemName=expertly-simple.ng-evergreen. It also bugs you to upgrade whenever there's a new release. – Doguhan Uluca May 18 '22 at 16:03