Npx Create React App giving out errors and ending without install - reactjs

I am getting errors whilst using the create-react-app. I am using Ubuntu, VSCode, npm. I tried clearing cache but the error still persists.
The errors are as follows:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: eslint#undefined
npm ERR! node_modules/eslint
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint#"^5.0.0 || ^6.0.0 || ^7.0.0" from #typescript-eslint/eslint-plugin#4.27.0
npm ERR! node_modules/#typescript-eslint/eslint-plugin
npm ERR! #typescript-eslint/eslint-plugin#"^4.5.0" from react-scripts#4.0.3
npm ERR! node_modules/react-scripts
npm ERR! react-scripts#"*" 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/yourdir/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/yourdir/.npm/_logs/2021-06-15T23_17_30_641Z-debug.log

It might be related to an issue with CRA.
https://github.com/npm/cli/issues/2128
https://github.com/facebook/create-react-app/issues/9995
At least it sounds similar. I'm currently experiencing this issue myself and have come across these.

Related

When I do command as "npm install" it comes ERRORs ( This code folder was download from GitHub)

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: berry-material-react-free#3.2.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.0" from #mui/styles#5.8.6
npm ERR! node_modules/#mui/styles
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\hp\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\hp\AppData\Local\npm-cache_logs\2022-11-16T10_57_14_537Z-debug-0.log
Can anyone help me for solve this?
This is due to inconsistent versioning inside the node packages. You can use the following command to ignore the versioning
npm install --legacy-peer-deps
Note that this is not the best solution since it might cause some behavior discrepancies in node packages. Best way is to figure out proper versioning to dependencies

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 !

Issues setting up react using Create React App

I am a newbie trying to set up React for the first time. I have an error when I am trying to install it on my computer. I have created a folder in my Documents folder for all the projects I was planning on making, if that makes a difference too. I am not running this in root. Below are the errors I keep getting and I am not sure what they mean. I have googled and found a few forum posts, but none of their solutions work. I am hoping it is something small I have missed.
Installing template dependencies using npm...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR!
While resolving: my-app#0.1.0
npm ERR! Found: react#18.0.0
npm ERR!
node_modules/react
npm ERR! react#"^18.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer
react#"<18.0.0" from #testing-library/react#12.1.5
npm ERR!
node_modules/#testing-library/react
npm ERR!
#testing-library/react#"^12.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\Luke\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\Luke\AppData\Local\npm-cache_logs\2022-04-12T04_55_21_058Z-debug-0.log
npm install --no-audit --save #testing-library/jest-dom#^5.14.1 #testing-library/react#^12.0.0 #testing-library/user-event#^13.2.1 web-vitals#^2.1.0 failed PS C:\Users\Luke\Documents\React-Projects>

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.

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