Reputation: 31
When trying to install plugin-gatsby-react-helment
getting the following error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/gatsby
npm ERR! gatsby@"^3.11.1" from the root project
npm ERR!
npm ERR! peer gatsby@"^4.0.0-next" from [email protected]
npm ERR! node_modules/gatsby-plugin-react-helmet
npm ERR! gatsby-plugin-react-helmet@"*" 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\Asus\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\Asus\AppData\Local\npm-cache\_logs\2021-12-24T14_44_33_845Z-debug.log
but react-helmet just install fine I am clueless
Upvotes: 1
Views: 2119
Reputation: 1
I faced the same error recently. Here's how you can fix it
package-lock.json
gatsby develop
or run npm i
If it doesn't work, delete node modules and try the above steps again
Upvotes: 0
Reputation: 29320
It's quite self-explanatory.
You have installed a Gatsby version ^3.11.1
as it is extracted from:
npm ERR! gatsby@"^3.11.1" from the root project
While gatsby-plugin-react-helmet
as is, without a specific version tries to install the latest one (5.4.0
). This latest version requires a Gatbsby version 4 onwards (major update) as it is extracted from:
npm ERR! peer gatsby@"^4.0.0-next" from [email protected]
npm ERR! node_modules/gatsby-plugin-react-helmet
npm ERR! gatsby-plugin-react-helmet@"*" from the root project
That said, depending on your specifications you have two options:
Upgrading the whole Gatsby project to 4: follow the migration guide
Installing a specific compatible gatsby-plugin-react-helmet
version by running:
npm install [email protected]
Note 1: Check the 4.14.0
details (or others) in the CHANGELOG.md
Note 2: Check the @
syntax details at: https://nodejs.dev/learn/install-an-older-version-of-an-npm-package
The second one will have a lower impact in your project but ideally, sooner or later you will need to upgrade the Gatsby version.
I guess, being a lower major update any version 4 of the gatsby-plugin-react-helmet
plugin should work. If not, try lowering the version.
Remember to clean the cache (with gatsby clean
) in each trial.
Upvotes: 2