mbrn / material-table

Datatable for React based on material-ui's table with additional features
https://material-table.com
MIT License
3.5k stars 1.02k forks source link

Can't install library #3209

Open MarianCN opened 1 year ago

MarianCN commented 1 year ago

Guidelines

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/lab@5.0.0-alpha.124
npm ERR!   node_modules/@mui/lab
npm ERR!     peer @mui/lab@"^5.0.0-alpha.72" from material-table@2.0.3
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/styles@5.5.0
npm ERR! node_modules/@mui/styles
npm ERR!   peer @mui/styles@"5.5.0" from material-table@2.0.3
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 ```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?

RamanChola commented 1 year ago

This is because you are using react 18 and the material table library current supports react 17. They need to update it.

mm0hammadi commented 1 year ago

try with npm install material-table --force I checked that it works with React 18

eybel commented 1 year ago

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?

RitchieP commented 1 year ago

try with npm install material-table --force I checked that it works with React 18

Have someone tried this? Will there be any issues?

GoDeeper96 commented 1 year ago

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

RitchieP commented 1 year ago

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

foggy54 commented 1 year ago

Confirm, having exactly same problem with React 18

RitchieP commented 1 year ago

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

StaanERP commented 1 year ago

npm i material-table Debugger attached. npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: stannerp002@0.1.0 npm ERR! Found: react@17.0.0 npm ERR! node_modules/react npm ERR! peer react@">=16.8.0" from @emotion/react@11.11.1 npm ERR! node_modules/@emotion/react npm ERR! @emotion/react@"^11.8.1" from react-select@5.8.0 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/use-insertion-effect-with-fallbacks@1.0.1 npm ERR! node_modules/@emotion/use-insertion-effect-with-fallbacks npm ERR! @emotion/use-insertion-effect-with-fallbacks@"^1.0.1" from @emotion/react@11.11.1 npm ERR! node_modules/@emotion/react npm ERR! @emotion/react@"^11.8.1" from react-select@5.8.0 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: react@17.0.2 npm ERR! node_modules/react npm ERR! peer react@"^17.0.2" from material-table@2.0.5 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 react@17.0.0 in can not install

GoDeeper96 commented 11 months ago

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.