Issues setting up react using Create React App - reactjs

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>

Related

I cannot run npm install - ERESOLVE could not resolve

I have recently just cloned my project on to a fresh computer from Github. I deleted my node modules and ran npm install and I was presented with:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #react-native-firebase/auth#14.2.1
npm ERR! Found: #react-native-firebase/app#13.0.1
npm ERR! node_modules/#react-native-firebase/app
npm ERR! #react-native-firebase/app#"^13.0.1" from the root project
npm ERR! peer #react-native-firebase/app#"13.0.1" from #react-native-firebase/storage#13.0.1
npm ERR! node_modules/#react-native-firebase/storage
npm ERR! #react-native-firebase/storage#"^13.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #react-native-firebase/app#"14.2.1" from #react-native-firebase/auth#14.2.1
npm ERR! node_modules/#react-native-firebase/auth
npm ERR! #react-native-firebase/auth#"^14.2.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #react-native-firebase/app#14.2.1
npm ERR! node_modules/#react-native-firebase/app
npm ERR! peer #react-native-firebase/app#"14.2.1" from #react-native-firebase/auth#14.2.1
npm ERR! node_modules/#react-native-firebase/auth
npm ERR! #react-native-firebase/auth#"^14.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.
npm ERR!
npm ERR! See /Users/jacksaunders/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jacksaunders/.npm/_logs/2022-06-18T18_48_11_817Z-debug-0.log
I have tried downgrading the packages, but I don't think I'm doing it right because it is not working. I have tried npm audit fix but that didn't work for me either and I am presented with the same error as above.
If anyone can help me get back up and running that would be great!
Thank you!
This error could be a directory issue. When cloning projects, you may have put your project folder inside a new folder you created. For example, C:/Users/myApp/myApp
Double check that your terminal you are running commands from is in the correct directory. This is a simple mistake I have made many times, causing that exact error.
If that is not the case, then I would freshly reinstall Firebase on this project. Check the log and see if all of the errors are firebase related from your code sample. Completely uninstalling firebase after npm install and installing the package separately can fix the issue.

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.

Npx Create React App giving out errors and ending without install

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.

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

Cannot run gatsby develop - There was a problem loading the local develop command

I am trying to run gatsby develop in order to start the development server but I am getting the following error:
There was a problem loading the local develop command. Gatsby may not be installed in your site's "node_modules" directory. Perhaps you need to run "npm install"? You might need to delete your "package-lock.json" as well.
This is the project that I am working on: https://github.com/andreiprv/andyprv-blog
Cloned from this repo: https://github.com/alxshelepenok/gatsby-starter-lumen
It is probably a dependency issue, but I don't have the know-how to figure out how to solve it. After I started the project with gatsby new etc, I've got the following errors:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: gatsby-starter-lumen#3.0.7
npm ERR! Found: react#17.0.1
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.4.2" from gatsby#2.28.0
npm ERR! node_modules/gatsby
npm ERR! gatsby#"^2.27.4" from the root project
npm ERR! peer gatsby#"*" from #sentry/gatsby#5.28.0
npm ERR! node_modules/#sentry/gatsby
npm ERR! #sentry/gatsby#"^5.27.6" 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/andreismbp/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/andreismbp/.npm/_logs/2020-12-04T17_22_00_512Z-debug.log
error Command failed with exit code 1: npm install
Error: Command failed with exit code 1: npm install
- error.js:56 makeError
[lib]/[gatsby-cli]/[execa]/lib/error.js:56:11
- index.js:114 handlePromise
[lib]/[gatsby-cli]/[execa]/index.js:114:26
- task_queues:93 processTicksAndRejections
node:internal/process/task_queues:93:5
- init-starter.js:135 install
[lib]/[gatsby-cli]/lib/init-starter.js:135:7
- init-starter.js:202 clone
[lib]/[gatsby-cli]/lib/init-starter.js:202:3
- init-starter.js:343 initStarter
[lib]/[gatsby-cli]/lib/init-starter.js:343:5
- create-cli.js:449
[lib]/[gatsby-cli]/lib/create-cli.js:449:9
I tried to uninstall and install gatsby again using npm uninstall --save gatsby && npm install --save gatsby
but it failed with the following errors
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: gatsby-starter-lumen#3.0.7
npm ERR! Found: react#17.0.1
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.4.2" from gatsby#2.28.0
npm ERR! node_modules/gatsby
npm ERR! peer gatsby#"*" from #sentry/gatsby#5.28.0
npm ERR! node_modules/#sentry/gatsby
npm ERR! #sentry/gatsby#"^5.27.6" 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/andreismbp/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/andreismbp/.npm/_logs/2020-12-04T17_51_08_843Z-debug.log
Thank you in advance!
Did the following, ran npm install --legacy-peer-deps
Then hit another error when running gatsby develop :
Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (88)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1
error undefined failed
Fixed the above by downgrading node to v14.15.1. After that I needed to run npm rebuild node-sass
I've resolved this issue by running yarn install instead of npm install
Not sure if this may be related, I had a similar issue, but mine was caused by a mismatch dependency between my node version and the version some library was using, so after changing to another version it worked for me.
I noticed that there was an error by running npm install --loglevel verbose
see if you can get additional information.

Resources