material-table
material-table copied to clipboard
Can't install library
Guidelines
-
Please include a demo of the issue/behavior/question you have
-
Please try to be as detailed as possible
I'm trying to run npm install material-table
and i get this error:
npm ERR! node_modules/@types/react
npm ERR! @types/react@"^18.0.32" from the root project
npm ERR! peerOptional @types/react@"^17.0.0 || ^18.0.0" from @mui/[email protected]
npm ERR! node_modules/@mui/lab
npm ERR! peer @mui/lab@"^5.0.0-alpha.72" from [email protected]
npm ERR! node_modules/material-table
npm ERR! material-table@"*" from the root project
npm ERR! 1 more (@mui/material)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional @types/react@"^16.8.6 || ^17.0.0" from @mui/[email protected]
npm ERR! node_modules/@mui/styles
npm ERR! peer @mui/styles@"5.5.0" from [email protected]
npm ERR! node_modules/material-table
npm ERR! material-table@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Marian\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Marian\AppData\Local\npm-cache\_logs\2023-04-02T18_30_19_099Z-debug-0.log
My package.json is:
package.json
{
"name": "myApp",
"version": "0.1.1",
"private": true,
"dependencies": {
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@mui/icons-material": "^5.11.11",
"@mui/material": "^5.11.15",
"@mui/styled-engine": "^5.11.11",
"@mui/x-data-grid": "^5.17.26",
"@reduxjs/toolkit": "^1.8.5",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.23",
"@types/react": "^18.0.32",
"@types/react-dom": "^18.0.11",
"@types/react-redux": "^7.1.25",
"@types/react-router-dom": "^5.3.3",
"@types/redux": "^3.6.0",
"axios": "^0.27.2",
"chart.js": "^4.2.1",
"classnames": "^2.3.2",
"copy-to-clipboard": "^3.3.2",
"mui-tel-input": "^2.0.1",
"react": "^18.2.0",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.2.0",
"react-quill": "^2.0.0",
"react-redux": "^8.0.2",
"react-router-dom": "^6.3.0",
"react-scripts": "^5.0.1",
"react-toastify": "^9.0.8",
"redux": "^4.2.0",
"sass": "^1.60.0",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}
}
Can anyone help me?
This is because you are using react 18 and the material table library current supports react 17. They need to update it.
try with npm install material-table --force I checked that it works with React 18
Will they update material table? I am using Next.js which goes well with React 18 and node 18 but it seems this supports react 17.
Any roadmap on this?
try with npm install material-table --force I checked that it works with React 18
Have someone tried this? Will there be any issues?
try with npm install material-table --force I checked that it works with React 18
Have someone tried this? Will there be any issues?
not working
I've tried to force install it, and it does work, at least for now, there's no issue when the app is running. The only issue I'm experiencing is:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
when trying to install other packages such as mongoose
. That said, I'm not very particularly sure whether is it a direct cause because of a forced install of material-table
or something else
Confirm, having exactly same problem with React 18
Most probably have to migrate to a fork of this repo, check out #3044
I'm not getting errors after migrating to the forked repo
npm i material-table Debugger attached. npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/react npm ERR! peer react@">=16.8.0" from @emotion/[email protected] npm ERR! node_modules/@emotion/react npm ERR! @emotion/react@"^11.8.1" from [email protected] npm ERR! node_modules/react-select npm ERR! react-select@"^5.8.0" from the root project npm ERR! peer react@">=16.8.0" from @emotion/[email protected] npm ERR! node_modules/@emotion/use-insertion-effect-with-fallbacks npm ERR! @emotion/use-insertion-effect-with-fallbacks@"^1.0.1" from @emotion/[email protected] npm ERR! node_modules/@emotion/react npm ERR! @emotion/react@"^11.8.1" from [email protected] npm ERR! node_modules/react-select npm ERR! react-select@"^5.8.0" from the root project npm ERR! 18 more (@react-aria/ssr, @restart/hooks, @restart/ui, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! material-table@"" from the root project npm ERR! npm ERR! Conflicting peer dependency: [email protected] npm ERR! node_modules/react npm ERR! peer react@"^17.0.2" from [email protected] npm ERR! node_modules/material-table npm ERR! material-table@"" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
on [email protected] in can not install
after some time, it is still not working but hey Material React Table just released v2 and it looks so much better, also released ways of adding rows that are similar to material table, I don't think there will be a need to use material table since Material React Table is so much better now.