'alpha' 未从“@mui/system”导出
'alpha' is not exported from '@mui/system'
拜托,我是从@mui/material 库中得到这个错误,我已经检查了 mui/system 的 package.json 并且其中导出了 alpha。
./node_modules/@mui/material/styles/index.js
Attempted import error: 'alpha' is not exported from '@mui/system'.
这是应用程序package.json
"dependencies": {
"@date-io/date-fns": "1.x",
"@emotion/react": "11.7.0",
"@emotion/styled": "11.6.0",
"@material-ui/core": "4.12.3",
"@material-ui/icons": "4.11.2",
"@mui/icons-material": "5.2.0",
"@mui/material": "^5.2.7",
"@mui/styled-engine-sc": "5.1.0",
"@mui/styles": "5.2.2",
"@mui/system": "^5.2.6",
"@reduxjs/toolkit": "1.6.2",
"@testing-library/jest-dom": "5.11.4",
"@testing-library/react": "11.1.0",
"@testing-library/user-event": "12.1.10",
"date-fns": "2.27.0",
"express": "4.17.1",
"react": "17.0.2",
"react-bootstrap": "2.0.2",
"react-bootstrap-icons": "1.6.1",
"react-circular-gradient-progress": "1.1.1",
"react-circular-progressbar": "2.0.4",
"react-dom": "17.0.2",
"react-icons": "4.3.1",
"react-organizational-chart": "2.1.0",
"react-redux": "7.2.6",
"react-router-dom": "5.2.0",
"react-scripts": "4.0.3",
"react-spring": "9.3.1",
"styled-components": "5.3.3",
"web-vitals": "1.0.1"
},
我的节点版本是v12.22.8
我认为问题在于您混合了 Material UI 版本 4 和版本 5 库,并且它们彼此不兼容。尝试将 @material-ui/core 替换为 @mui/core 并删除 @material-ui/icons 导入,因为您已经拥有 @mui/icons-material 并使用所有 @mui/* 导入的最新版本。
在再次安装依赖项之前清除node_modules,以确保一切正常并删除旧的依赖项版本。
编辑:最终需要解决的问题 - 安装节点 v12.22.7,删除 node_modules,清理纱线缓存并重新安装依赖项
拜托,我是从@mui/material 库中得到这个错误,我已经检查了 mui/system 的 package.json 并且其中导出了 alpha。
./node_modules/@mui/material/styles/index.js
Attempted import error: 'alpha' is not exported from '@mui/system'.
这是应用程序package.json
"dependencies": {
"@date-io/date-fns": "1.x",
"@emotion/react": "11.7.0",
"@emotion/styled": "11.6.0",
"@material-ui/core": "4.12.3",
"@material-ui/icons": "4.11.2",
"@mui/icons-material": "5.2.0",
"@mui/material": "^5.2.7",
"@mui/styled-engine-sc": "5.1.0",
"@mui/styles": "5.2.2",
"@mui/system": "^5.2.6",
"@reduxjs/toolkit": "1.6.2",
"@testing-library/jest-dom": "5.11.4",
"@testing-library/react": "11.1.0",
"@testing-library/user-event": "12.1.10",
"date-fns": "2.27.0",
"express": "4.17.1",
"react": "17.0.2",
"react-bootstrap": "2.0.2",
"react-bootstrap-icons": "1.6.1",
"react-circular-gradient-progress": "1.1.1",
"react-circular-progressbar": "2.0.4",
"react-dom": "17.0.2",
"react-icons": "4.3.1",
"react-organizational-chart": "2.1.0",
"react-redux": "7.2.6",
"react-router-dom": "5.2.0",
"react-scripts": "4.0.3",
"react-spring": "9.3.1",
"styled-components": "5.3.3",
"web-vitals": "1.0.1"
},
我的节点版本是v12.22.8
我认为问题在于您混合了 Material UI 版本 4 和版本 5 库,并且它们彼此不兼容。尝试将 @material-ui/core 替换为 @mui/core 并删除 @material-ui/icons 导入,因为您已经拥有 @mui/icons-material 并使用所有 @mui/* 导入的最新版本。
在再次安装依赖项之前清除node_modules,以确保一切正常并删除旧的依赖项版本。
编辑:最终需要解决的问题 - 安装节点 v12.22.7,删除 node_modules,清理纱线缓存并重新安装依赖项