To Solve ERESOLVE Unable to resolve dependency tree error You just need to set legacy-peer-deps will resolve this error. You just need to run the below command in your terminal: npm config set legacy-peer-deps true And now your error will be solved permanently.
Solution 1: Downgrading node version
You have dependency conflict (incorrect and potentially broken dependency) as it says, So try to run the command with --force
, or --legacy-peer-deps
. If it doesn’t take effect, the temporary solution is using prior versions of the node (Downgrading node version) as it causes to happen such this kind of errors sometimes.
Solution 2: Use –legacy-peer-deps
Use this command
npm install --save --legacy-peer-deps
Solution 3: npm config set legacy-peer-deps true
In addition to using the --legacy-peer-deps
command line option, this can also be set more permanently as a config option:
npm config set legacy-peer-deps true
Solution 4: Try npm cache clean –force
Try removing the node modules
and package-lock.json
file and run the command npm install
or Try npm cache clean --force
Solution 5: Set legacy-peer-deps
To Solve ERESOLVE Unable to resolve dependency tree error You just need to set legacy-peer-deps will resolve this error. You just need to run the below command in your terminal.
npm config set legacy-peer-deps true
And now your error will be solved permanently.
Solution 6: Use –force command
While You are installing any npm package just add –force at the end of your installation command. For Example, I am trying to install sass then my command will look like this.
npm install sass --force
And now, you will no longer face this error.
Summary
So either you need to downgrade nodejs Or set legacy-peer-deps will resolve this error. Hope our solution worked for you. Thanks.
Also, Read
- ReferenceError: fetch is not defined in nodejs
- SyntaxError: Cannot use import statement outside a module in nodeJs
- npm ERR! cb.apply is not a function
thank you
it helped, thank yoy
this is very helpful,tq
thank you
thank you
I have another efficient solution its.
try this >> npm config set legacy-peer-deps true
Thank You For Your Suggestion mohamed salah ♥
Solution 3 worked for me thank you
My pleasure to help You Pam
you save my time. thank you!!!
My pleasure to help You Kim and Thank You For your Valuable Word!
Great thank you it’s perfectly working good
My pleasure to help You sabariesh and Thank You For your Valuable Word!
very very very thank you (heart)
It’s my Pleasure to Help You ali. Thank You For Your Valuable words.
Thank you so much bro!This helped me a lot
It’s my Pleasure to Help You Tej. Thank You For Your Valuable words.