最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - MUI v5: Can't resolve '@emotionreact' in '...node_modules@muistyled-engine'

programmeradmin0浏览0评论
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.

Share Improve this question edited Oct 31, 2021 at 7:36 NearHuscarl 81.8k22 gold badges319 silver badges281 bronze badges asked Sep 27, 2021 at 18:33 animath labanimath lab 291 silver badge2 bronze badges 2
  • 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
Add a ment  | 

1 Answer 1

Reset to default 8

Before 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?
发布评论

评论列表(0)

  1. 暂无评论