Han*_*Han 50 reactjs material-ui
当我尝试从 Material UI 导入一些图标时,我可以看到此错误。我按照建议安装了一些模块,但仍然没有修复。
包.json
"@material-ui/core": "^4.12.3",
"@mui/icons-material": "^5.0.1",
"@mui/lab": "^5.0.0-alpha.49",
Run Code Online (Sandbox Code Playgroud)
我尝试使用以下命令安装 /utils,
$ npm install @mui/material/utils
Run Code Online (Sandbox Code Playgroud)
错误:
npm ERR! code ENOLOCAL
npm ERR! Could not install from "@mui\material\utils" as it does not
contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Han\AppData\Roaming\npm-cache\_logs\2021-10-03T21_47_03_649Z-debug.log
Run Code Online (Sandbox Code Playgroud)
有什么我错过的吗?
**经过一番研究,我删除了“@material-ui/core”并安装了“@mui/core”。我认为出现此错误是因为名称从material更改为mui?
"@mui/core": "^5.0.0-alpha.49",
"@mui/icons-material": "^5.0.1",
"@mui/lab": "^5.0.0-alpha.49",
"@mui/utils": "^5.0.1",
Run Code Online (Sandbox Code Playgroud)
谢谢。
Gas*_*ass 31
在安装MUI 组件库之前安装MUI 图标包 时会发生此错误。MUI 图标包需要包才能正常工作。@mui/material @emotion/react @emotion/styled
运行以下行之一
// with npm
npm install @mui/material @emotion/react @emotion/styled
// or if you prefer yarn
yarn add @mui/material @emotion/react @emotion/styled
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
150992 次 |
| 最近记录: |