I'm new with Gatsby and I am trying to start a project based on Gatsby + Ghost but I can solve this problem that appears right away I execute the command from the official github page:
$ gatsby new gatsby-starter-ghost https://github.com/TryGhost/gatsby-starter-ghost.git
info Creating new site from git: https://github.com/TryGhost/gatsby-starter-ghost.git
Cloning into 'gatsby-starter-ghost'...
remote: Enumerating objects: 80, done.
remote: Counting objects: 100% (80/80), done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 80 (delta 2), reused 42 (delta 2), pack-reused 0
success Created starter directory layout
info Installing packages...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: gatsby-starter-ghost#2.0.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#"^16.9.0" from #tryghost/helpers-gatsby#1.0.50
npm ERR! node_modules/#tryghost/helpers-gatsby
npm ERR! #tryghost/helpers-gatsby#"1.0.50" 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/mabvmex/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
ERROR
Command failed with exit code 1: npm install
Error: Command failed with exit code 1: npm install
Any help would be very appreciated.
Thanks in advance.
As it is prompted:
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"17.0.2" from the root project
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.9.0" from #tryghost/helpers-gatsby#1.0.50
npm ERR! node_modules/#tryghost/helpers-gatsby
npm ERR! #tryghost/helpers-gatsby#"1.0.50" 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
You are running React v17.0.2 which it's a major upgrade from the required React version (^16.9.0). You should be able to run your project with your current version of React but you may need to install the peer dependencies by:
npm install gatsby#latest --legacy-peer-deps
Note: remove the package-lock, your node_modules and potentially your .cache folder before running it.
Related
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>
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.
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
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
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.