0

I have these dev dependencies in my Angular 13 project

  "devDependencies": {
    "@angular-devkit/build-angular": "~13.2.5",
    "@angular/cli": "~13.2.5",
    "@angular/compiler-cli": "~13.2.0",

When I run npm i, I get this error

npm ERR! Conflicting peer dependency: @angular/compiler@13.2.7
npm ERR! node_modules/@angular/compiler
npm ERR!   peer @angular/compiler@"13.2.7" from @angular/compiler-cli@13.2.7
npm ERR!   node_modules/@angular/compiler-cli
npm ERR!     dev @angular/compiler-cli@"~13.2.0" from the root project
npm ERR!     peer @angular/compiler-cli@"^13.0.0" from @angular-devkit/build-angular@13.2.6
npm ERR!     node_modules/@angular-devkit/build-angular
npm ERR!       dev @angular-devkit/build-angular@"~13.2.5" from the root project
npm ERR!     1 more (@ngtools/webpack)

I'm confused about how to resolve this. Does this mean I need to upgrade my compiler cli or downgrade my devkit? I'm also confused about how to figureout what the appropriate compatible versions are. How do I figure out the appropriate version of devkit to satisfy the "npm i" process?

Dave
  • 15,639
  • 133
  • 442
  • 830
  • If you are stuck at this part for a long time and need to solve this asap, just add `--force` at the end of you npm i @xxx – Parsa Arvaneh Aug 24 '22 at 14:20
  • Thanks, unfortunately I'm trying to get my code to build with a Git action that uses "npm i". It is not an option to adjust the parameters of the Git action so I'm trying to figure out what the error above means. – Dave Aug 24 '22 at 15:51

1 Answers1

0

The @angular/compiler-cli version does not match your @angular/compiler version which is located under dependencies

mxmissile
  • 11,464
  • 3
  • 53
  • 79
CarlitosJan
  • 183
  • 8
  • Hate to be dense, but can you spell it out for me? Does the @angular/compiler-cli version listed under devDependencies need to be 13.2.7? – Dave Aug 24 '22 at 15:38
  • Yes I think so. You have to change it in your package.json – CarlitosJan Aug 25 '22 at 06:04