skip to Main Content

The error is –

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!   peer @material-ui/core@"^4.0.0" from @material-ui/[email protected]
npm ERR!   node_modules/@material-ui/icons
npm ERR!     @material-ui/icons@"^4.11.3" 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.

Also, while doing so, it is not creating the node_modules/ directory.
I am not able to understand the issue here and idk how to fix this. If anyone know how to, pls help.

2

Answers


  1. How are you?
    This is because, @material-ui doesn’t support React 18,
    which is you are now using.

    So you can either downgrade React to v17.

    Or you can install other version of Material UI.

    You can check this issue.

    https://github.com/mui/material-ui/issues/32074

    Login or Signup to reply.
  2. Common error you are using latest version or react 18.2 but in this project mui is using react ^16.8.0 or ^17.0.0 that’s why you are getting peer dependency conflict.

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