reactjs 未找到模块:错误:无法解析“@mui/base”

ycl3bljg  于 2023-05-22  发布在  React
关注(0)|答案(2)|浏览(345)

我刚刚安装了mui,发现了这样的消息:

Compiled with problems:

ERROR in ./node_modules/@mui/material/AccordionActions/AccordionActions.js 7:0-70

Module not found: Error: Can't resolve '@mui/base' in 'C:\..\node_modules\@mui\material\AccordionActions'

顺便说一句,我用的是Yarn。在终端我得到

webpack compiled with 253 errors and 1 
warning

这是我的package.json依赖项:

"dependencies": {
    "@emotion/react": "^11.9.0",
    "@emotion/styled": "^11.8.1",
    "@mui/icons-material": "^5.8.2",
    "@mui/material": "^5.8.2",
    "@mui/styled-engine-sc": "^5.8.0",
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^13.3.0",
    "@testing-library/user-event": "^13.5.0",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-router-dom": "5.3.0",
    "react-scripts": "5.0.1",
    "styled-components": "^5.3.5",
    "web-vitals": "^2.1.4"
  },

我用过yarn add @mui/base,但还是这样,有解决办法吗?

wgeznvg7

wgeznvg72#

首先简单地安装MUI基座。如果你正在使用npm,那么使用这个命令:

npm install @mui/base

如果你正在使用yarn,那么使用这个命令:

yarn add @mui/base

相关问题