问题描述
我有一个react django应用程序的材料-ui。我过去经常导入和材料界面图标,没有任何问题。今天,我甚至无法构建我的应用程序后,从材料导入一个新的图标-ui。
从“@mui/图标-material”导入WebIcon;
这是当我尝试启动我的react应用程序时的错误信息,
> react-scripts start
Starting the development server...
Failed to compile.
./node_modules/@mui/icons-material/utils/createSvgIcon.js
Module not found: Can't resolve '@mui/material/utils' in
'/home/ztaye/Documents/Work/Afropa/code/afropa/frontend/node_modules/@mui/icons-
material/utils'
/home/ztaye/Documents/Work/Afropa/code/afropa/frontend/node_modules/react-
scripts/scripts/start.js:19
throw err;
^
Error: ENOENT: no such file or directory, stat '/initrd.img'
期望
我只是怀疑错误来自他们的新更新。我试着用这个链接重新安装这个软件包,它没有工作。
发布于 2021-10-06 10:56:20
这是材料用户界面更新后的向后兼容性问题。当我替换了所有的
@mui/icons-material/
至
@material-ui/icons/
在每个图标上导入。
发布于 2021-09-21 11:46:56
我不知道Django,但在我的反应中,我导入了:从‘@material ui/图标/ArrowForwardIos’导入ArrowForwardIosIcon;
如果您像这样安装它: npm i@material ui/图标
https://stackoverflow.com/questions/69274498
复制