My React APP currently has the old material-ui install.
How to uninstall it and install the latest MUI?
EDITED:
package.json:
"dependencies": {
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"@mui/icons-material": "^5.0.1",
"@reduxjs/toolkit": "^1.6.1",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@testing-library/user-event": "^13.2.1",
"axios": "^0.21.1",
"dotenv": "^10.0.0",
"object-hash": "^2.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-icons": "^4.3.1",
"react-redux": "^7.2.4",
"react-router": "^5.2.1",
"react-router-dom": "^5.2.1",
"react-scripts": "4.0.3",
"redux": "^4.1.1",
"sass": "^1.38.2",
"socket.io-client": "^4.1.3",
"timeago.js": "^4.0.2",
"web-vitals": "^2.1.0"
},
My React APP currently has the old material-ui install.
How to uninstall it and install the latest MUI?
EDITED:
package.json:
"dependencies": {
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"@mui/icons-material": "^5.0.1",
"@reduxjs/toolkit": "^1.6.1",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@testing-library/user-event": "^13.2.1",
"axios": "^0.21.1",
"dotenv": "^10.0.0",
"object-hash": "^2.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-icons": "^4.3.1",
"react-redux": "^7.2.4",
"react-router": "^5.2.1",
"react-router-dom": "^5.2.1",
"react-scripts": "4.0.3",
"redux": "^4.1.1",
"sass": "^1.38.2",
"socket.io-client": "^4.1.3",
"timeago.js": "^4.0.2",
"web-vitals": "^2.1.0"
},
Share
Improve this question
edited Dec 31, 2021 at 23:13
Bear Bile Farming is Torture
asked Dec 31, 2021 at 23:07
Bear Bile Farming is TortureBear Bile Farming is Torture
5,1738 gold badges41 silver badges118 bronze badges
4
-
1
npm uninstall
/npm install
? – tromgy Commented Dec 31, 2021 at 23:09 - I am having trouble with the precise package names – Bear Bile Farming is Torture Commented Dec 31, 2021 at 23:11
- 1 You need to post your package.json then. – tromgy Commented Dec 31, 2021 at 23:12
-
2
Just do
npm uninstall @material-ui/core @material-ui/icons
and donpm install @mui/material
– shidoro Commented Dec 31, 2021 at 23:27
2 Answers
Reset to default 3This is how you remove packages from your dependencies in project.json
npm uninstall --save <package_name>
Material UI has changed its package names in v5. In your scenario, you are migrating from v4 to v5. You can follow the Material UI migration from v4 to v5 here.
Basically you should install the new @mui
packages , update your application code as needed and then you can remove old @material-ui
packages.
Following that guide you should do some changes or update some ponents depending on your application.