8
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: card@0.1.0
npm ERR! Found: react@18.0.0
npm ERR! node_modules/react
npm ERR!   react@"^18.0.0" from the root project
npm ERR!   peer react@"\>=16.8.0" from @emotion/react@11.8.2
npm ERR!   node_modules/@emotion/react
npm ERR!     @emotion/react@"*" from the root project*
npm ERR!     peerOptional @emotion/react@"^11.5.0" from @mui/material@5.5.3
npm ERR!     node_modules/@mui/material
npm ERR!       @mui/material@"" from the root project
npm ERR!     1 more (@emotion/styled)
npm ERR!   1 more (@emotion/styled)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.0" from @mui/material@5.5.3
npm ERR! node_modules/@mui/material
npm ERR!   @mui/material@"\*" 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\\Fine Traders\\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\\Fine Traders\\AppData\\Local\\npm-cache_logs\\2022-03-31T07_38_37_266Z-debug.log

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: card@0.1.0
npm ERR! Found: react@18.0.0
npm ERR! node_modules/react
npm ERR!   react@"^18.0.0" from the root project
npm ERR!   peer react@"\>=16.8.0" from @emotion/react@11.8.2
npm ERR!   node_modules/@emotion/react
npm ERR!     @emotion/react@"*" from the root project*
npm ERR!     peerOptional @emotion/react@"^11.5.0" from @mui/material@5.5.3
npm ERR!     node_modules/@mui/material
npm ERR!       @mui/material@"" from the root project
npm ERR!     1 more (@emotion/styled)
npm ERR!   1 more (@emotion/styled)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.0" from @mui/material@5.5.3
npm ERR! node_modules/@mui/material
npm ERR!   @mui/material@"\*" 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\\Fine Traders\\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\\Fine Traders\\AppData\\Local\\npm-cache_logs\\2022-03-31T07_38_37_266Z-debug.log
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Noor Muhammad
  • 91
  • 1
  • 2

3 Answers3

8

run npm install <dependencyName> --force or npm install <dependencyName> --legacy-peer-deps

Eragon_18
  • 720
  • 7
  • 11
3

npm install --force it works with react v18.0

faced an issue with npm install @material-ui/core and then tried it with

npm install @material-ui/core --force and then it installed

Sanket Shelke
  • 101
  • 1
  • 2
0

If you're on react v18.0, it is most likely that the package is not fully compatible with react v18.0. In this case, downgrading to react v17 usually solves the issue.

Follow the answer here: https://stackoverflow.com/a/71908461/16855529 on how to go down to react v17.

Xarty
  • 13
  • 3