Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you read npm audit ERESOLVE error?

I often receive error ERESOLVE similar to below. How do you read it?

>npm audit fix
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/compiler
npm ERR!   @angular/compiler@"12.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler@"12.1.1" from @angular/[email protected]
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   dev @angular/compiler-cli@"^12.1.0" from the root project
npm ERR!   peer @angular/compiler-cli@"^12.0.0 || ^12.1.0-next" from @angular-devkit/[email protected]
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"12.1.0" from the root project

And how do you read it - Which package depends on which? Which end of the tree I have control of? Top or bottom?

Did I add @angular-devkit/build-angular into my app and it needs but cant find angular/compiler ? or is it the other way around?

like image 775
Boppity Bop Avatar asked Apr 10 '26 02:04

Boppity Bop


1 Answers

I can be wrong but this is what I read:

Which package depends on which?

Your app directly depends on:

  • @angular/compiler@"12.1.0"
  • @angular/compiler-cli@"^12.1.0"
  • @angular-devkit/build-angular@"12.1.0"

Your app transitively depends on:

  • @angular/compiler@"12.1.1" from @angular/[email protected] <- which is the actual @angular/compiler-cli version installed in your node_modules.
  • @angular/compiler-cli@"^12.0.0 || ^12.1.0-next" from @angular-devkit/[email protected] <- which is the actual @angular-devkit/build-angular version installed in your node_modules.

So what I read is that there is a conflict because your app directly depends on @angular/compiler@"12.1.0" and transitively on @angular/compiler@"12.1.1" (from @angular/[email protected]) You can probably fix this by adding what it looks like a missing caret, ie @angular/compiler@"^12.1.0".

Unrelated ^, I had a similar problem but all versions where compatible. I deleted package-lock.json and node_modules and installed them again and it worked fine.

like image 127
mike Avatar answered Apr 12 '26 16:04

mike



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!