MUI installation doesn't work with React 18
See original GitHub issueDuplicates
- 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:
- npx create-react-app myproject
- 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>
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:32 (7 by maintainers)
Top GitHub Comments
We are going to release a new version of Material UI later today. It will be possible to use it with React 18.
Almost there… #32131