creativetimofficial / material-kit-react

Material Kit React free and open source by Creative Tim
https://www.creative-tim.com/product/material-kit-react?ref=mkr-readme
1.19k stars 2.13k forks source link

npm install causes ERESOLVE error #99

Closed marcveens closed 2 years ago

marcveens commented 2 years ago

I just downloaded the repo and tried to install it, but ran into this error:

# npm resolution error report

2022-04-13T12:38:50.933Z

While resolving: @mui/material@5.2.0
Found: @emotion/react@11.4.1
node_modules/@emotion/react
  @emotion/react@"11.4.1" from the root project
  peer @emotion/react@"^11.0.0-rc.0" from @emotion/styled@11.3.0
  node_modules/@emotion/styled
    @emotion/styled@"11.3.0" from the root project
    peerOptional @emotion/styled@"^11.3.0" from @mui/material@5.2.0
    node_modules/@mui/material
      @mui/material@"5.2.0" from the root project
      peer @mui/material@"^5.0.0" from @mui/icons-material@5.2.0
      node_modules/@mui/icons-material
        @mui/icons-material@"5.2.0" from the root project
    peerOptional @emotion/styled@"^11.3.0" from @mui/styled-engine@5.2.0
    node_modules/@mui/styled-engine
      @mui/styled-engine@"5.2.0" from the root project
  peerOptional @emotion/react@"^11.4.1" from @mui/styled-engine@5.2.0
  node_modules/@mui/styled-engine
    @mui/styled-engine@"5.2.0" from the root project

Could not resolve dependency:
peerOptional @emotion/react@"^11.5.0" from @mui/material@5.2.0
node_modules/@mui/material
  @mui/material@"5.2.0" from the root project
  peer @mui/material@"^5.0.0" from @mui/icons-material@5.2.0
  node_modules/@mui/icons-material
    @mui/icons-material@"5.2.0" from the root project

Conflicting peer dependency: @emotion/react@11.9.0
node_modules/@emotion/react
  peerOptional @emotion/react@"^11.5.0" from @mui/material@5.2.0
  node_modules/@mui/material
    @mui/material@"5.2.0" from the root project
    peer @mui/material@"^5.0.0" from @mui/icons-material@5.2.0
    node_modules/@mui/icons-material
      @mui/icons-material@"5.2.0" from the root project

Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

Running on Windows, npm 7.21.1, Node 16.9.1

Mohmedvaid commented 2 years ago

The same thing is happening on my end as well.

sajadevo commented 2 years ago

Hi @marcveens

Thanks for using our product, please use one of the following methods and it will fix your issue:

Method 1: Run the following command: npm i --legacy-peer-deps Method2: Download yarn globally: npm i -g yarn and then inside the product directory run the following command: yarn install

Note: To get the latest updates and supports for the products and other related things to Creative Tim please join our Discord Community.

All the best, Sajad
 React Developer @ Creative-Tim.com