4
npm i angular-in-memory-web-api --save-dev
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: ng-naruto-app@0.0.0
npm ERR! Found: @angular/common@13.3.11
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"~13.3.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^14.0.0" from angular-in-memory-web-api@0.14.0
npm ERR! node_modules/angular-in-memory-web-api
npm ERR!   dev angular-in-memory-web-api@"*" 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 /home/ts/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ts/.npm/_logs/2022-07-09T23_51_26_110Z-debug-0.log
R. Richards
  • 24,603
  • 10
  • 64
  • 64

2 Answers2

5

The package you're trying to install is not matching your project's Angular version. To fix this issue you need to install the version 0.13 of the package : npm i angular-in-memory-web-api@0.13.0 --save-dev

1

Here your angular version is 13 as shown in error.

Found: @angular/common@13.3.11

Open this package on npmjs website and look at the versions.

Go to required version and find the install command for that version on top right corner.

Like if your angular version is 14.2.2 install version 14 of angular-in-memory-web-api package.