Skip to content

MUI installation doesn't work with React 18 #32074

Closed
@juhahinkula

Description

@juhahinkula

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

Installation doesn't work with current React 18.0.0 version using npm. See the error below. The project has been created using the latest create-react-app. Installation works when using yarn.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: carshop@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@"^11.8.2" 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@"^5.5.3" from the root project
npm ERR! 1 more (@mui/icons-material)
npm ERR! 1 more (@emotion/styled)
npm ERR! 1 more (@emotion/styled)

Expected behavior 🤔

Component should be installed.

Steps to reproduce 🕹

Steps:

  1. npx create-react-app myproject
  2. npm install @mui/material @emotion/react @emotion/styled

Context 🔦

No response

Your environment 🌎

`npx @mui/envinfo`
  System:
    OS: Windows 10 10.0.19044
  Binaries:
    Node: 16.13.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.15 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 8.3.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.19041.1266.0), Chromium (99.0.1150.55)
  npmPackages:
    @emotion/react: ^11.8.2 => 11.8.2
    @emotion/styled: ^11.8.1 => 11.8.1
    @mui/icons-material: ^5.5.1 => 5.5.1
    @mui/material: ^5.5.3 => 5.5.3
    @mui/types:  7.1.3
    @types/react:  17.0.43
    react: ^18.0.0 => 18.0.0
    react-dom: ^18.0.0 => 18.0.0
    typescript:  4.6.3```
</details>

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreInfrastructure work going on behind the scenesduplicateThis issue or pull request already exists

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions