Cannot install @material-ui/core with npm 7 and React 17
See original GitHub issueOn the base template of create-react-app v4 with typescript material-ui/core complains about the version of react.
Steps to Reproduce 🕹
Step 1: Run - npx create-react-app . --template typescript Step 2: Run - npm i @material-ui/core
Error fron console
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR! react@"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from @material-ui/core@4.11.0
npm ERR! node_modules/@material-ui/core
npm ERR! @material-ui/core@"*" from the root project
- [ x] I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
material ui core does not install
Expected Behavior 🤔
isntall material-ui core
Your Environment 🌎
Fresh linux Ubuntu installation. 20.10
Tech | Version |
---|---|
Material-UI | default LTS |
React | 17.0.1 |
TypeScript | true |
Node | 15.0.1 |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:27
- Comments:27 (12 by maintainers)
Top Results From Across the Web
Cannot install @material-ui/core with npm 7 and React 17
On the base template of create-react-app v4 with typescript material-ui/core complains about the version of react.
Read more >cannot install @material-ui/core using npm - Stack Overflow
Try yarn add @material-ui/core & yarn add @material-ui/core React 17 dont support material UI install previous versions or use yarn It will ...
Read more >@material-ui/core - npm
React components that implement Google's Material Design.. Latest version: 4.12.4, last published: 9 months ago.
Read more >Installation - Material UI - MUI
Install Material UI, the world's most popular React UI framework. Default installation. Run one of the following commands to add Material UI to...
Read more >@material-ui/core | Yarn - Package Manager
Material UI v4 doesn't receive active development since September 2021. ... React components that implement Google's Material Design. react, react-component ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I encountered the same error the other day (also after scaffolding via CRA & TypeScript as seen in OP). Using npm v7.0.3 does yield additional output:
Following the instructions I ran
and Material UI installed fine without downgrading npm or React.
DISCLAIMER: Use at own risk. Things may break. Material UI v4 does not officially support React v17. You’re encouraged to either switch to React v16 or wait for Material UI v5.
I’ve only tested a few components and features. Everything seems fine so far, but I don’t know whether there are any lurking compatibility issues between
@material-ui/core@"v4.11.0"
andreact@"^17.0.1"
at this point. Do proceed with caution until v5 (or potential official support in v4?) gets released.i think create-react-app is now defaulting to react v17, and it looks from above like nextJS does too. so expect a lot more duplicated issues I guess?