EDIT: Just discovered that not one single module installed through npm install --save
can be resolved. The issue seems to be therefore with all modules even though they are located inside node_modules folder.
I have been debugging this error for the last 2 hours. Note that the application has been created with create-react-app
tool.
This is how I am importing the module:
import AppBar from "@material-ui/core/AppBar";
import Button from "@material-ui/core/Button";
import Icon from "@material-ui/core/Icon";
import IconButton from "@material-ui/core/IconButton";
import Tabs from "@material-ui/core/Tabs";
import Tab from "@material-ui/core/Tab";
This is the package.json
snippet:
...
"dependencies": {
"@material-ui/core": "^1.5.1",
"@material-ui/icons": "^1.1.1",
...
To solve the error "Module not found: Error: Can't resolve '@mui/material'", make sure to install the package by opening your terminal in your project's root directory and running the command npm i @mui/material @emotion/react @emotion/styled and restart your development server.
The solution that worked for me is the following:
npm install @material-ui/core
Check the link https://www.npmjs.com/package/@material-ui/core
Try - yarn add @material-ui/core
This resolved the broken dependencies between materialui and react. Worked for me in my case, it was @material-ui/core/chippedInput that was missing.
In my case I was following a tutorial and ended up with an import as
import AppBar from 'material-ui/AppBar';
Instead of using the following which is in documentation here.
import AppBar from '@material-ui/core/AppBar';
// or
import { AppBar } from '@material-ui/core';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With