0

As a beginner, I am following the Angular Tutorial > Your First Angular App. In the first lesson, there is instructed to run the npm install command, to install the necessary packages. But npm throws errors when installing this.

I found to solve this, appending the command with --force so > npm install --force

I think it is not done not guiding this possible problem in the tutorial ... I lost 2–3 hours to solve this... as a beginner.

This is the error I got.

$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: angular.io-example@0.0.0
npm ERR! Found: @angular/common@16.0.1
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"^16.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^15.0.0" from angular-in-memory-web-api@0.15.0
npm ERR! node_modules/angular-in-memory-web-api
npm ERR!   angular-in-memory-web-api@"~0.15.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!
npm ERR! For a full report see:
npm ERR! C:\Users\xxxxx\AppData\Local\npm-cache\_logs\2023-05-10T20_29_24_501Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xxxxx\AppData\Local\npm-cache\_logs\2023-05-10T20_29_24_501Z-debug-0.log
Wocky
  • 11
  • 3

0 Answers0