Home > Mobile >  so i have been trying to installing material ui in my project and i have been keep seeing these erro
so i have been trying to installing material ui in my project and i have been keep seeing these erro

Time:05-12

PS C:\Users\chand\OneDrive\Desktop\react\amazon-clone> npm install @material-ui/icons
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.1.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!   peer @material-ui/core@"^4.0.0" from @material-ui/[email protected]
npm ERR!   node_modules/@material-ui/icons
npm ERR!     @material-ui/icons@"*" 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\chand\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\chand\AppData\Local\npm-cache\_logs\2022-05-11T20_28_09_686Z-debug-0.log
PS C:\Users\chand\OneDrive\Desktop\react\amazon-clone> 

CodePudding user response:

You have added amazon-clone as a dependency, which requires a version of react. You have added [email protected], but it requires v16 or 17 as specified in the error message.

e.g.

npm install [email protected]

They obviously don't have released support for v18 yet, or it might be on a dev branch.

Just choose an appropriate version that matches the requirement.

  • Related