skip to Main Content

I tried many ways to resolve this from cleaning cache to installing dependancies, like:-

npm install –legacy-peer-deps
npm install @reduxjs/toolkit react-redux
npm install @reduxjs/toolkit react-redux –legacy-peer-deps
npm cache clean –force
npm install –save –legacy-peer-deps

Then I tried to set legacy peer deps true using :- npm config set legacy-peer-deps true
And then I installed legacy peer deps and tried again.
npm install –save –legacy-peer-deps
After this I installed packages like :-
npm i @material-ui/core
npm i @material-ui/icons
and it worked…..

It might show some vulnerabilities but it would run fine.

I was trying to install material ui core and icon package but couldn’t complete it because of issue with dependency tree.

2

Answers


  1. Chosen as BEST ANSWER

    You can try different ways it may work but instead of installing packages again and again

    1. Set legacy peer deps as true :- npm config set legacy-peer-deps true
    2. Then install legacy peer deps :- npm install --save --legacy-peer-deps[using this]
    3. Then try installing your packages

  2. npm config set legacy-peer-deps true
    npm cache clean --force
    

    If it is not working then delete your node modules file and again install it. Also check your node and npm version

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search