Recently after installing react-collapsed package with npm there was no issue with running on localhot and everything was as expected. However after building on AWS Amplify I encountered the following dependency error. I've tried npm ci to clean up the dependencies with no luck. Any tips would be greatly appreciated!
2023-02-03T05:34:40.280Z [WARNING]: ERR! ERESOLVE could not resolve
npm ERR!
2023-02-03T05:34:40.280Z [WARNING]: npm ERR! While resolving: react-collapsed#3.6.0
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR!
2023-02-03T05:34:40.281Z [WARNING]: react#"^18.2.0" from the root project
npm ERR! peer react#"^18.2.0" from react-dom#18.2.0
npm ERR! node_modules/react-dom
npm ERR! react-dom#"^18.2.0" from the root project
npm ERR! 3 more (react-router, react-router-dom, react-scripts)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8 || ^17" from react-collapsed#3.6.0
2023-02-03T05:34:40.281Z [WARNING]: npm ERR! node_modules/react-collapsed
npm ERR! react-collapsed#"^3.6.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#17.0.2
npm ERR! node_modules/react
npm ERR! peer react#"^16.8 || ^17" from react-collapsed#3.6.0
npm ERR! node_modules/react-collapsed
npm ERR! react-collapsed#"^3.6.0" from the root project
npm ERR!
2023-02-03T05:34:40.281Z [WARNING]:
Tried uninstalling which reverted the issue, npm ci didn't resolve the issue
After some digging it appears that react-collapsed removed support for react 18 temporarily: https://github.com/roginfarrer/collapsed/pull/120. Rolling back to react-collapsed#3.0 solved the issue
Related
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: rss-feed#0.1.0
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! peer react#"16.13.1" from the root project
npm ERR! peer react#"^18.0.0" from #testing-library/react#13.4.0
npm ERR! node_modules/#testing-library/react
npm ERR! #testing-library/react#"^13.4.0" from the root project
npm ERR! 2 more (react-dom, react-scripts)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"16.13.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#16.13.1
npm ERR! node_modules/react
npm ERR! peer react#"16.13.1" 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!
Not sure what happened, but everything is in disarray now. I've tried nuking node-modules, cleaning npm cache, forcing the install and using the flag --legacy-peer-deps,
but nothing is working and I'm still getting this error. I could really use a different direction here, and I'm not sure why this started happening in the first place.
My project structure looks like this:
I have recently updated my react project from React v16 to v18. It builds on my local machine using npm run build. But after deploying in Aws Amplify to build it gives error! Throwing whole log below. Is it something from npm error or While resolving: #material-ui/core#4.12.4 on the log showed so?
2022-12-14T10:37:14.709Z [INFO]: # Executing command: npm install
2022-12-14T10:37:19.882Z [WARNING]: npm ERR! code
2022-12-14T10:37:19.884Z [WARNING]: ERESOLVE
2022-12-14T10:37:19.904Z [WARNING]: npm
2022-12-14T10:37:19.904Z [WARNING]: ERR! ERESOLVE could not resolve
npm ERR!
npm ERR!
2022-12-14T10:37:19.904Z [WARNING]: While resolving: #material-ui/core#4.12.4
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! react#"^18.2.0" from the root project
2022-12-14T10:37:19.904Z [WARNING]: npm ERR! peerOptional react#"^16.8.0 || ^17.0.0 ||
^18.0.0" from #apollo/client#3.7.2
npm ERR! node_modules/#apollo/client
npm ERR! #apollo/client#"^3.3.14" from the root
project
npm ERR! #apollo/client#"latest" from #apollo/react-
components#4.0.0
npm ERR! node_modules/#apollo/react-components
npm ERR! #apollo/react-components#"^4.0.0-beta.2"
from the root project
npm ERR! 33 more (#aws-amplify/ui-react, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8.0 || ^17.0.0" from #material-
ui/core#4.12.4
2022-12-14T10:37:19.905Z [WARNING]: npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"^4.11.3" from the root
project
npm ERR!
npm ERR! Conflicting peer dependency: react#17.0.2
npm ERR! node_modules/react
npm ERR! peer react#"^16.8.0 || ^17.0.0" from
#material-ui/core#4.12.4
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"^4.11.3" 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
2022-12-14T10:37:19.905Z [WARNING]: ERR! to accept an incorrect (and potentially broken)
dependency resolution.
npm ERR!
npm ERR! See /root/.npm/eresolve-report.txt for a full
report.
2022-12-14T10:37:19.906Z [WARNING]:
2022-12-14T10:37:19.906Z [WARNING]: npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-12-14T10_37_14_924Z-
debug-0.log
2022-12-14T10:37:19.918Z [ERROR]: !!! Build failed
2022-12-14T10:37:19.918Z [ERROR]: !!! Non-Zero Exit Code detected
2022-12-14T10:37:19.918Z [INFO]: # Starting environment caching...
2022-12-14T10:37:19.918Z [INFO]: # Uploading environment cache artifact...
2022-12-14T10:37:20.001Z [INFO]: # Uploaded environment cache artifact
2022-12-14T10:37:20.001Z [INFO]: # Environment caching completed
Terminating logging...
Can anyone help me out? Thanks in advance.
If you use React 18, you should use it with #mui/material v5 instead of #material-ui/core.
https://mui.com/material-ui/getting-started/overview/
I have a little problem with my new react app and I would like to know what can I do to fix it?
I think it's a minor problem but I'm not seeing it so sorry for bothering you guys.
(Btw, don't mind the name Pinterbest, it's a practice work, I'm not going to publish it for real lol)
Here's the logs when updating packages:
`npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-google-login#5.2.2
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! react#"^18.2.0" from the root project
npm ERR! peer react#"^18.0.0" from u/testing-library/react#13.4.0
npm ERR! node_modules/#testing-library/react
npm ERR! u/testing-library/react#"^13.4.0" from the root project
npm ERR! 8 more (react-dom, react-icons, react-loader-spinner, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16 || ^17" from react-google-login#5.2.2
npm ERR! node_modules/react-google-login
npm ERR! react-google-login#"^5.2.2" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#17.0.2
npm ERR! node_modules/react
npm ERR! peer react#"^16 || ^17" from react-google-login#5.2.2
npm ERR! node_modules/react-google-login
npm ERR! react-google-login#"^5.2.2" 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\user\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\user\AppData\Local\npm-cache_logs\2022-11-04T15_02_24_966Z-debug-0.log`
I tryed to install packages following a tutorial and then got these logs.
I have materials-ui already installed and when i tried to install other react packages im getting this error and nothing related to npm is working properly please help
PS
C:\Users\panna\OneDrive\Desktop\forms\google_form> npm install #mui/lab
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #material-ui/core#4.12.4
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! peer react#"^17.0.0 || ^18.0.0" from #mui/base#5.0.0-alpha.105
npm ERR! node_modules/#mui/base
npm ERR! #mui/base#"5.0.0-alpha.105" from #mui/material#5.10.13
npm ERR! node_modules/#mui/material
npm ERR! #mui/material#"^5.10.13" from the root project
npm ERR! 1 more (#mui/lab)
npm ERR! #mui/base#"5.0.0-alpha.105" from #mui/lab#5.0.0-alpha.107
npm ERR! node_modules/#mui/lab
npm ERR! #mui/lab#"*" from the root project
npm ERR! peer react#"^17.0.0 || ^18.0.0" from #mui/material#5.10.13
npm ERR! node_modules/#mui/material
npm ERR! #mui/material#"^5.10.13" from the root project
npm ERR! peer #mui/material#"^5.0.0" from #mui/lab#5.0.0-alpha.107
npm ERR! node_modules/#mui/lab
npm ERR! #mui/lab#"*" from the root project
npm ERR! 11 more (#mui/private-theming, #mui/styled-engine, #mui/system, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8.0 || ^17.0.0" from #material-ui/core#4.12.4
npm ERR! node_modules/#material-ui/core
npm ERR! peer #material-ui/core#"^4.0.0" from #material-ui/icons#4.11.3
npm ERR! node_modules/#material-ui/icons
npm ERR! #material-ui/icons#"^4.11.3" from the root project
npm ERR! #material-ui/core#"^4.12.4" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#17.0.2
npm ERR! node_modules/react
npm ERR! peer react#"^16.8.0 || ^17.0.0" from #material-ui/core#4.12.4
npm ERR! node_modules/#material-ui/core
npm ERR! node_modules/#material-ui/icons
npm ERR! #material-ui/icons#"^4.11.3" from the root project
npm ERR! #material-ui/core#"^4.12.4" 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\panna\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\panna\AppData\Local\npm-cache\_logs\2022-11-13T18_48_18_070Z-debug-0.log
og
I tried uninstalling materials ui and many more thing whatever was availble on the net but couldnt find anything similar , it is my first time using reacts packages please help
This is because you are using React 18 with MUI v4
you can choose one of these approaches:
Update your MUI to v5
or
Downgrade your React Version to 17
or if you want to keep these version just simply use this flag --legacy-peer-deps
for example: npm install #mui/lab --legacy-peer-deps
then you can install everything
But Preferably Update your MUI to version 5.
I am trying to deploy a website but am unable to understand why it exits with error code 1. I tried deleting node modules and npm installing them again but it did not work.
Edit: I added --legacy-peer-deps after npm install and it worked. Seemed to be the issue with react and #mui.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #material-ui/core#5.0.0-beta.5
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! react#"^18.2.0" from the root project
npm ERR! peer react#">=16.8.0" from #emotion/react#11.10.4
npm ERR! node_modules/#emotion/react
npm ERR! #emotion/react#"^11.10.0" from the root project
npm ERR! peer #emotion/react#"^11.0.0-rc.0" from #emotion/styled#11.10.4
npm ERR! node_modules/#emotion/styled
npm ERR! #emotion/styled#"^11.10.0" from the root project
npm ERR! 7 more (#material-ui/core, #material-ui/styled-engine, ...)
npm ERR! 7 more (#material-ui/core, #material-ui/styled-engine, ...)
npm ERR! 29 more (#emotion/styled, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^17.0.2" from #material-ui/core#5.0.0-beta.5
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"^5.0.0-beta.5" 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-ui/core#5.0.0-beta.5
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"^5.0.0-beta.5" 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 /home/runner/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2022-09-03T14_20_38_138Z-debug-0.log
Error: Process completed with exit code 1.