angularnpmangular-in-memory-web-api

Trying to npm install angular-in-memory-web-api and I'm getting errors


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

Solution

  • 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