Home > front end >  I got error "npm ERR! code ERESOLVE" when trying to update Angular app
I got error "npm ERR! code ERESOLVE" when trying to update Angular app

Time:11-28

I'm just trying to update the website application designed with Angular and got this error. I think there's something I'm missing but I couldn't find. code-simples

"C:\Program Files\nodejs\npm.cmd" install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @agm/[email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"15.0.1" from the root project
npm ERR!   peer @angular/common@"^14.0.0 || ^15.0.0" from @angular/[email protected]
npm ERR!   node_modules/@angular/cdk
npm ERR!     @angular/cdk@"14.2.1" from the root project
npm ERR!     peer @angular/cdk@"14.2.1" from @angular/[email protected]
npm ERR!     node_modules/@angular/material
npm ERR!       @angular/material@"14.2.1" from the root project
npm ERR!       2 more (@angular/material-moment-adapter, mat-table-exporter)
npm ERR!     3 more (@swimlane/ngx-charts, mat-table-exporter, cdk-table-exporter)
npm ERR!   17 more (@angular/flex-layout, @angular/forms, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^9.1.0 || ^10.0.0" from @agm/[email protected]
npm ERR! node_modules/@agm/core
npm ERR!   @agm/core@"3.0.0-beta.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/[email protected]
npm ERR! node_modules/@angular/common
npm ERR!   peer @angular/common@"^9.1.0 || ^10.0.0" from @agm/[email protected]
npm ERR!   node_modules/@agm/core
npm ERR!     @agm/core@"3.0.0-beta.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.
npm ERR!
npm ERR! See C:\Users\ardac\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ardac\AppData\Local\npm-cache\_logs\2022-11-28T12_42_43_429Z-debug-0.log

Process finished with exit code 1

I'm trying to do Angular documentation rules one by one

CodePudding user response:

Have you tried this ?

npm install --legacy-peer-deps --force

CodePudding user response:

Your project angular version is different than your local system version.

npm i @agm/core

The above library dependency is causing conflicts with commons. Kindly install it before doing npm i.

  • Related