How to solve react dependencies caught in GitHub actions? - reactjs

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.

Related

I have a problem installing react dependencies

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.

Some issues with dependencies which i cant resolve

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #react-native-community/async-storage#1.12.1
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"^17.0.2" from the root project
npm ERR! peer react#">=16.3.0" from #callstack/react-theme-provider#3.0.7
npm ERR! node_modules/#callstack/react-theme-provider
npm ERR! #callstack/react-theme-provider#"^3.0.7" from react-native-paper#4.12.4
npm ERR! node_modules/react-native-paper
npm ERR! react-native-paper#"^4.12.4" from the root project
npm ERR! 25 more (#react-native-community/masked-view, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8" from #react-native-community/async-storage#1.12.1
npm ERR! node_modules/#react-native-community/async-storage
npm ERR! #react-native-community/async-storage#"^1.12.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#16.14.0
npm ERR! node_modules/react
npm ERR! peer react#"^16.8" from #react-native-community/async-storage#1.12.1
npm ERR! node_modules/#react-native-community/async-storage
npm ERR! #react-native-community/async-storage#"^1.12.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.
The package #react-native-community/async-storage was renamed to #react-native-async-storage/async-storage when it was removed out of the #react-native-community scope.
In your package.json file, replace #react-native-community/async-storage with the updated #react-native-async-storage/async-storage package!

Why do I keep getting errors while trying to install MUI packages

I'm trying to install MUI libraries however I keep getting these errors:
Here is what I've tried:
npm install --force
npm install --legacy-peer-deps
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: filmpire_jsm#0.1.0
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! peer react#"^18.0.0" from #testing-library/react#13.3.0
npm ERR! node_modules/#testing-library/react
npm ERR! #testing-library/react#"^11.1.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! peer react-dom#"^18.0.0" from #testing-library/react#13.3.0
npm ERR! node_modules/#testing-library/react
npm ERR! #testing-library/react#"^11.1.0" from the root project
npm ERR! react-dom#"^17.0.2" from the root project
npm ERR! 1 more (#mui/material)
npm ERR! 5 more (the root project, #emotion/react, #emotion/styled, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! #mui/styles#"^5.0.1" 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.0" from #mui/styles#5.10.2
npm ERR! node_modules/#mui/styles
npm ERR! #mui/styles#"^5.0.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!
npm ERR! See /Users/samiennaciri/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/samiennaciri/.npm/_logs/2022-08-26T02_57_25_208Z-debug-0.log```
Remove your node_modules folder and package-lock.json file, then run npm i --legacy-peer-deps

Problem with installing react 18 + typescript + redu-toolkit

I have a problem with creating project with new react 18/ typescript and redux-toolkit.
I am trying to install #reduxjs/toolkit, but I see an error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #reduxjs/toolkit#1.8.0
npm ERR! Found: react#18.0.0
npm ERR! node_modules/react
npm ERR! peer react#"*" from #testing-library/react#12.1.4
npm ERR! node_modules/#testing-library/react
npm ERR! #testing-library/react#"^12.1.4" from the root project
npm ERR! peer react#"^18.0.0" from react-dom#18.0.0
npm ERR! node_modules/react-dom
npm ERR! peer react-dom#"*" from #testing-library/react#12.1.4
npm ERR! node_modules/#testing-library/react
npm ERR! #testing-library/react#"^12.1.4" from the root project
npm ERR! react-dom#"^18.0.0" from the root project
npm ERR! 2 more (react-scripts, the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional react#"^16.9.0 || ^17.0.0 || 18.0.0-beta" from #reduxjs/toolkit#1.8.0
npm ERR! node_modules/#reduxjs/toolkit
npm ERR! #reduxjs/toolkit#"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#17.0.2
npm ERR! node_modules/react
npm ERR! peerOptional react#"^16.9.0 || ^17.0.0 || 18.0.0-beta" from #reduxjs/toolkit#1.8.0
npm ERR! node_modules/#reduxjs/toolkit
npm ERR! #reduxjs/toolkit#"*" 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.
This will be fixed by a new release in the next few days - until then you will have to run the command with --force or --legacy-peer-deps as shown in the command.
Edit: should be working now: https://twitter.com/acemarke/status/1509540340088328196

npm ERR! ERESOLVE unable to resolve dependency tree when installing react-spring animation

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! peer react#">=16.x" from #fortawesome/react-fontawesome#0.1.14
npm ERR! node_modules/#fortawesome/react-fontawesome
npm ERR! #fortawesome/react-fontawesome#"^0.1.14" from the root project
npm ERR! peer react#"*" from #testing-library/react#11.2.5
npm ERR! node_modules/#testing-library/react
npm ERR! #testing-library/react#"^11.1.0" from the root project
npm ERR! 5 more (react-dom, react-scripts, the root project, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.0.0" from react-reconciler#0.20.4
npm ERR! node_modules/react-zdog/node_modules/react-reconciler
npm ERR! react-reconciler#"^0.20.4" from react-zdog#1.0.11
npm ERR! node_modules/react-zdog
npm ERR! peer react-zdog#">=1.0" from #react-spring/zdog#9.0.0
npm ERR! node_modules/#react-spring/zdog
npm ERR! #react-spring/zdog#"^9.0.0" from react-spring#9.0.0
npm ERR! node_modules/react-spring
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\FUJITSU\AppData\Local\npm-cache\eresolve-report.txt for a full report.

Resources