Home > Blockchain >  npm i @material-ui/core not workinng
npm i @material-ui/core not workinng

Time:09-04

I am trying to install material ui in my project, but its not working Here is the error I am getting :

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^18.2.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0 || ^17.0.0" from @material-ui/[email protected]
npm ERR! node_modules/@material-ui/core
npm ERR!   @material-ui/core@"*" 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! See C:\Users\prajw\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\prajw\AppData\Local\npm-cache\_logs\2022-09-03T13_27_14_263Z-debug-0.log

What can be the possible command to install material UI core

CodePudding user response:

You can't install @material-ui/core with React version 18

Possible solutions:

  1. Downgrade react to version 17 using npm install [email protected]

  2. Wait until they will support react 18

CodePudding user response:

This mainly happens due to dependency conflict. Force the installation by using the following command and see if it resolves your issue:

 npm i @material-ui/core --force,
  • Related