Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install - ERESOLVE unable to resolve dependency tree

I am trying to npm install but getting this error.

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/cdk
npm ERR!   @angular/cdk@"9.2.4" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/cdk@"8.2.3" from @angular/[email protected]
npm ERR! node_modules/@angular/material
npm ERR!   @angular/material@"8.2.3" 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.
like image 709
Matt Avatar asked Feb 04 '26 20:02

Matt


1 Answers

try npm install --legacy-peer-deps . This worked for me. But first make sure you delete your package-lock.json and node_modules.

like image 57
Franklin Ukaegbu Avatar answered Feb 07 '26 09:02

Franklin Ukaegbu



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!