React NPM Error - code ERESOLVE, ERESOLVE could not resolve - reactjs

In my react-native app, When I try to install npm i google-spreadsheet --save I get below error.
How to fix it ?
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-dom#18.2.0
npm ERR! Found: react#18.1.0
npm ERR! node_modules/react
npm ERR! peer react#"18.1.0" from react-native#0.70.6
npm ERR! node_modules/react-native
npm ERR! peerOptional react-native#">=0.59" from react-redux#8.0.5
npm ERR! node_modules/react-redux
npm ERR! react-redux#"^8.0.5" from the root project
npm ERR! react-native#"0.70.6" from the root project
npm ERR! peer react#"^16.8 || ^17.0 || ^18.0" from react-redux#8.0.5
npm ERR! node_modules/react-redux
npm ERR! react-redux#"^8.0.5" from the root project
npm ERR! 4 more (react-shallow-renderer, react-test-renderer, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^18.2.0" from react-dom#18.2.0
npm ERR! node_modules/react-dom
npm ERR! peerOptional react-dom#"^16.8 || ^17.0 || ^18.0" from react-redux#8.0.5
npm ERR! node_modules/react-redux
npm ERR! react-redux#"^8.0.5" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#18.2.0
npm ERR! node_modules/react
npm ERR! peer react#"^18.2.0" from react-dom#18.2.0
npm ERR! node_modules/react-dom
npm ERR! peerOptional react-dom#"^16.8 || ^17.0 || ^18.0" from react-redux#8.0.5
npm ERR! node_modules/react-redux
npm ERR! react-redux#"^8.0.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 C:\Users\harry\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\harry\AppData\Local\npm-cache\_logs\2023-02-06T05_01_54_912Z-debug-0.log

Related

when I write npm install -D tailwindcss in my vscode terminal then it shows " npm EER! code ERESOLVE"

npm install -D tailwindcss
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.1.0
npm ERR! node_modules/react
npm ERR! peer react#">=16.8.0" from #react-oauth/google#0.2.8
npm ERR! node_modules/#react-oauth/google
npm ERR! #react-oauth/google#"^0.2.6" from the root project
npm ERR! peer react#"^17.0.2 || ^18.0.0-0" from next#12.1.6
npm ERR! node_modules/next
npm ERR! next#"12.1.6" from the root project
npm ERR! peer next#">=10.2.0" from eslint-config-next#12.1.6
npm ERR! node_modules/eslint-config-next
npm ERR! dev eslint-config-next#"12.1.6" from
the root project
npm ERR! 6 more (react-dom, react-icons, styled-jsx, ...)
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\visitor\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\visitor\AppData\Local\npm-cache_logs\2022-10-28T06_41_44_897Z-debug-0.log
I was expecting that Tailwind css to be installed
Try to install it using the legacy peer dependencies flag.
npm install -D tailwindcss --legacy-peer-deps

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!

Error when installing material ui in react

I am trying to use material ui core but I am getting an error when installing it with npm in a react and typescript application.
The command I used in the root of the project is:
npm install #mui/material #emotion/react #emotion/styled
Material UI website
The error I got is:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #mui/core#5.0.0-alpha.54
npm ERR! Found: #types/react#18.0.15
npm ERR! node_modules/#types/react
npm ERR! peerOptional #types/react#"^17.0.0 || ^18.0.0" from #mui/base#5.0.0-alpha.95
npm ERR! node_modules/#mui/base
npm ERR! #mui/base#"5.0.0-alpha.95" from #mui/material#5.10.3
npm ERR! node_modules/#mui/material
npm ERR! #mui/material#"^5.10.3" from the root project
npm ERR! 1 more (#mui/icons-material)
npm ERR! peerOptional #types/react#"^17.0.0 || ^18.0.0" from #mui/icons-material#5.10.3
npm ERR! node_modules/#mui/icons-material
npm ERR! #mui/icons-material#"^5.10.3" from the root project
npm ERR! 9 more (#mui/private-theming, #mui/system, #mui/types, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional #types/react#"^16.8.6 || ^17.0.0" from #mui/core#5.0.0-alpha.54
npm ERR! node_modules/#mui/core
npm ERR! #mui/core#"^5.0.0-alpha.54" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #types/react#17.0.49
npm ERR! node_modules/#types/react
npm ERR! peerOptional #types/react#"^16.8.6 || ^17.0.0" from #mui/core#5.0.0-alpha.54
npm ERR! node_modules/#mui/core
npm ERR! #mui/core#"^5.0.0-alpha.54" 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/username/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/username/.npm/_logs/2022-09--debug-0.log
user#User'sPC projectName % npm install #mui/material #emotion/react #emotion/styled
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #mui/core#5.0.0-alpha.54
npm ERR! Found: #types/react#18.0.15
npm ERR! node_modules/#types/react
npm ERR! peerOptional #types/react#"^17.0.0 || ^18.0.0" from #mui/base#5.0.0-alpha.95
npm ERR! node_modules/#mui/base
npm ERR! #mui/base#"5.0.0-alpha.95" from #mui/material#5.10.3
npm ERR! node_modules/#mui/material
npm ERR! #mui/material#"^5.10.3" from the root project
npm ERR! 1 more (#mui/icons-material)
npm ERR! peerOptional #types/react#"^17.0.0 || ^18.0.0" from #mui/icons-material#5.10.3
npm ERR! node_modules/#mui/icons-material
npm ERR! #mui/icons-material#"^5.10.3" from the root project
npm ERR! 9 more (#mui/private-theming, #mui/system, #mui/types, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional #types/react#"^16.8.6 || ^17.0.0" from #mui/core#5.0.0-alpha.54
npm ERR! node_modules/#mui/core
npm ERR! #mui/core#"^5.0.0-alpha.54" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #types/react#17.0.49
npm ERR! node_modules/#types/react
npm ERR! peerOptional #types/react#"^16.8.6 || ^17.0.0" from #mui/core#5.0.0-alpha.54
npm ERR! node_modules/#mui/core
npm ERR! #mui/core#"^5.0.0-alpha.54" 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/username/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/username/.npm/_logs/2022-09-debug-0.log
My relevant package.json is:
"dependencies": {
"#emotion/react": "^11.10.4",
"#emotion/styled": "^11.10.4",
"#mui/core": "^5.0.0-alpha.54",
"#mui/icons-material": "^5.10.3",
"#mui/material": "^5.10.3",
"#mui/styled-engine-sc": "^5.10.3",
},
I removed the #mui/core dependency and then tried the command: npm i --save #mui/core as suggested by the answer in the comment, however I got the following error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving:projectname#0.1.0
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! react#"^18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^17.0.2" from #mui/core#5.0.0-alpha.54
npm ERR! node_modules/#mui/core
npm ERR! #mui/core#"^5.0.0-alpha.54" 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/username/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/username/.npm/_logs/2022-09--debug-0.log
I have no idea what this error means so would appreciate any help thanks!
Run these command
npm config set legacy-peer-deps true
npm i --save #mui/core
npm i #mui/styles

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