Module not found: Can't resolve '@emotion/react' in '...\node_modules\@mui\styled-engine'
I got a pilation failed problem for using Material-UI in a ReactJS project
I check the @mui node_modules
folder but can't fix the pilation bug. Anyone who have any idea please share with me.
Module not found: Can't resolve '@emotion/react' in '...\node_modules\@mui\styled-engine'
I got a pilation failed problem for using Material-UI in a ReactJS project
I check the @mui node_modules
folder but can't fix the pilation bug. Anyone who have any idea please share with me.
-
You might need to run
yarn
to install missed packages. – kost Commented Sep 27, 2021 at 18:44 - thanks i have now solution for this bug – animath lab Commented Sep 27, 2021 at 18:55
1 Answer
Reset to default 8Before using MUI, you should skim the installation guide to see if there are any required packages that you might be missing. In v5, MUI drops the JSS styling library (actually just mark it as obsolete and plan to remove it in v6) in favor of emotion as a default styling engine. If you don't use styled-ponent or any other third-party styling libraries and expect to use MUI right away, you still have to install emotion to use MUI styling API.
npm install @mui/material @emotion/react @emotion/styled
Related answer
- MUI v5: Do I need to install @emotion/react or @emotion/styled to use sx prop?