I have been trying to download a template to start customizing it. Upon downloading it, one is supposed to install all local dependencies using npm install or yarn install. I have done both of those and I have gotten the same error both times. Moreover I have tried using the same command with --force and --legacy-peer-deps, as advised in the error message. I found a GitHub issue discussing this precise problem and some other stack overflow threads. I have tried everything I have come across, and it is just not working. Moreover I have installed the recommended version of node, so that is not the problem either, as suggested in a different thread.
The error message can be seen below.
While resolving: @mui/[email protected]
npm ERR! Found: @emotion/[email protected]
npm ERR! node_modules/@emotion/react
npm ERR! @emotion/react@"11.4.1" from the root project
npm ERR! peer @emotion/react@"^11.0.0-rc.0" from @emotion/[email protected]
npm ERR! node_modules/@emotion/styled
npm ERR! @emotion/styled@"11.3.0" from the root project
npm ERR! peerOptional @emotion/styled@"^11.3.0" from @mui/[email protected]
npm ERR! node_modules/@mui/material
npm ERR! @mui/material@"5.2.0" from the root project
npm ERR! 1 more (@mui/icons-material)
npm ERR! 1 more (@mui/styled-engine)
npm ERR! 1 more (@mui/styled-engine)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional @emotion/react@"^11.5.0" from @mui/[email protected]
npm ERR! node_modules/@mui/material
npm ERR! @mui/material@"5.2.0" from the root project
npm ERR! peer @mui/material@"^5.0.0" from @mui/[email protected]
npm ERR! node_modules/@mui/icons-material
npm ERR! @mui/icons-material@"5.2.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @emotion/[email protected]
npm ERR! node_modules/@emotion/react
npm ERR! peerOptional @emotion/react@"^11.5.0" from @mui/[email protected]
npm ERR! node_modules/@mui/material
npm ERR! @mui/material@"5.2.0" from the root project
npm ERR! peer @mui/material@"^5.0.0" from @mui/[email protected]
npm ERR! node_modules/@mui/icons-material
npm ERR! @mui/icons-material@"5.2.0" 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.
The template: https://www.creative-tim.com/product/material-dashboard-react?ref=readme-mdr#
GitHub issue: https://github.com/creativetimofficial/material-dashboard-react/issues/171
Thanks in advance.
CodePudding user response:
The problem was solved by going into the package.json of my project and changing @emotion/react from 11.4.1 to 11.5.0, as it says that that is where the dependency issue takes place.
