Dependencies installation error for React - reactjs

While I am trying to install dependencies for the client, as below, the following errors were shown. What does it mean and how can I resolve it?
npm install axios moment react-file-base64 redux redux-thunk
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: client#0.1.0
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"^17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^15.0.2" from react-file-base64#1.0.3
npm ERR! node_modules/react-file-base64
npm ERR! react-file-base64#"*" 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/owen/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:

Answer from my comment:
react-file-base64 depends on react 15, but you depend on react 17. try: a) downgrading or b) running it with --force
The fix: run with --force

Related

Upstream dependency conflict, npm sanity/client

I'm trying to make a nextjs/sanity project at the moment, and I think I may have installed sanity client twice, but not entirely sure.
This is the error I'm getting in the command terminal:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: next-sanity-image#3.2.1
npm ERR! Found: #sanity/client#3.3.6
npm ERR! node_modules/#sanity/client
npm ERR! #sanity/client#"^3.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #sanity/client#"^2.11.0" from next-sanity-image#3.2.1
npm ERR! node_modules/next-sanity-image
npm ERR! next-sanity-image#"^3.2.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #sanity/client#2.23.2
npm ERR! node_modules/#sanity/client
npm ERR! peer #sanity/client#"^2.11.0" from next-sanity-image#3.2.1
npm ERR! node_modules/next-sanity-image
npm ERR! next-sanity-image#"^3.2.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.
I have tried npm install --legacy-peer-deps but it isn't fixing this error. I am currently trying to do npm install --save #babel/preset-react, which is what triggered these error messages. What is it that I need to do?
I think your sanity client is deprecated.
Try to delete all your sanity dependencies (#sanity/client#"^3.2.0" / "next-sanity-image": "^3.2.1") listed by your error message in your package.json.
Then, simply try to re-install Sanity --> npm i sanity.
And it should work !

npm i react-google-login is not able to install

I am trying to install the package "react-google-login" in my project for user authentication.
Here is the error code :
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: client#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#"^16 || ^17" from react-google-login#5.2.2
npm ERR! node_modules/react-google-login
npm ERR! react-google-login#"*" 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\prajw\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\prajw\AppData\Local\npm-cache\_logs\2022-08-30T16_30_08_237Z-debug-0.log
I think there is some error with version of react
I think this may fix your issues. try this
npm i react-google-login --legacy-peer-deps
What does this do? it ignores old dependencies for this package.
You can learn more about legacy peer deps here

Can't Install React Typical

I don't know what happened, but when I tried this command npm i react-typical then I got error like below:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: random#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! node_modules/react-typical
npm ERR! react-typical#"*" 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-08-06T13_20_53_259Z-debug-0.log
Try the following command:
npm install --save --legacy-peer-deps
See details on legacy peer dependancies here.
You can also try:
npm install react-typical --force
If that doesn't work, see this website for other solutions such as downgrading NPM.

Facing Issue while installing dependency issue in React project

I'm getting the following error when I attempt to install a new dependency in my React project:
C:\Users\abhinavverma Desktop Sodexo-Fe Matchiq-fe> npm i #cypress/instrument-cra
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree,
npm ERR! npm ERR! While resolving: match-iq#0.1.0
npm ERR! Found: prettier#1. 19.1
npm ERR! node_modules/prettier
npm ERR! dev prettier#"^1.19.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer prettier#">=2.0.0" from pretty-quick#3.1.1 I
npm ERR! node_modules/pretty-quick
npm ERR! dev pretty-quick#"^3.0.0" 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\abhinavverma 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\abhinavverma\AppData\Local\npm-cache_logs 2021-08-12T18_35_58_522Z-debug.log
run the command again with --force on the end. It can't find the correct version of the dependency. It looks like the version is wrong.

ERESOLVE unable to resolve dependency tree in react

Trying add dependencies react but i cannot install any packages. I recently deleted a package-lock.json to resolve ELOCKVERIFY error. I eventually installed the following command of 'npm audit fix' but I still carry the same ERESOLVE error.
npm audit fix
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: client#0.1.0
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.0.0" from react-simple-typewriter#1.0.13
npm ERR! node_modules/react-simple-typewriter
npm ERR! react-simple-typewriter#"^1.0.13" 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\Owner\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\Owner\AppData\Local\npm-cache\_logs\2021-05-11T19_07_29_767Z-debug.log
react-simple-typewriter version 1.0.13 requires version 16.x, while you have version 17.0.2.
Either upgrade react-simple-typewriter to a version that supports React 17.x (if there is one) or downgrade React to 16.x

Resources