Npm is not getting installed - reactjs

I am trying to setup this project. I m trying to do npm i, but it is not working. I have tried other commands as well; for say:
npm i --ignore-platform-dependencies
npm i --force
npm i --legacy-peer-deps
But it still shows;
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! While resolving: hello-next#1.0.0
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"^17.0.0" from the root project
npm ERR! Could not resolve dependency:
npm ERR! peer react#">=0.14.0 <17.0.0" from react-burger-menu#2.9.2
npm ERR! node_modules/react-burger-menu
npm ERR! react-burger-menu#"^2.7.1" from the root project
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! See C:\Users\nas\AppData\Local\npm-cache\eresolve-report.txt for a full report.
I have changed the version and have tried to resolve dependencies conflict, but again some other dependency conflict arise.
What's the method of dealing with us project? How do I get it installed?

Related

Dependency conflict. Unable to resolve dependency tree

I'm creating React project and use Mantine library. When I try to install #modulz/radix-icons dependency I get error messages that there is a dependency conflict . How can I solve this problem?
Error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-mantine-app#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.x || ^17.x" from #modulz/radix-icons#4.0.0
npm ERR! node_modules/#modulz/radix-icons
npm ERR! #modulz/radix-icons#"*" 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\igorg\AppData\Local\npm-cache\eresolve-report.txt for a full report.
use npm install --legacy-peer-deps

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.

Dependencies installation error for React

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

Resources