我刚刚安装了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
,但还是这样,有解决办法吗?
2条答案
按热度按时间pvcm50d11#
看看这个链接:第一个是官方素材UI,第二个是npm
wgeznvg72#
首先简单地安装MUI基座。如果你正在使用npm,那么使用这个命令:
如果你正在使用yarn,那么使用这个命令: