Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New project fails to npm install #19

Open
Asgaroth opened this issue Oct 30, 2021 · 4 comments
Open

New project fails to npm install #19

Asgaroth opened this issue Oct 30, 2021 · 4 comments

Comments

@Asgaroth
Copy link

I was just following the instructions at

gatsby new some-blog https://github.com/gatsbyjs/gatsby-starter-wordpress-blog

But npm fails to install with

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!   peer react@"^16.9.0 || ^17.0.0" from [email protected]
npm ERR!   node_modules/gatsby
npm ERR!     gatsby@"^4.0.0" from the root project
npm ERR!     peer gatsby@"^4.0.0-next" from [email protected]
npm ERR!     node_modules/gatsby-plugin-image
npm ERR!       gatsby-plugin-image@"^2.0.0" from the root project
npm ERR!       1 more (gatsby-source-wordpress)
npm ERR!     11 more (gatsby-plugin-sharp, gatsby-source-filesystem, ...)
npm ERR!   8 more (react-dom, gatsby-plugin-image, gatsby-plugin-offline, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^0.13.0 || ^0.14.0 || ^15.0.0 || ^16.0.0" from [email protected]
npm ERR! node_modules/react-helmet/node_modules/react-side-effect
npm ERR!   react-side-effect@"^1.1.0" from [email protected]
npm ERR!   node_modules/react-helmet
npm ERR!     react-helmet@"^5.2.1" from the root project
npm ERR!     1 more (gatsby-plugin-react-helmet)
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! 
@hansdb
Copy link

hansdb commented Nov 12, 2021

Changed react-helmet version from 5.2.1 to 6.1.0 (latest) in package.json fixes the npm install issue. Not sure if it is fully backwards compatible with v5.

@bzx
Copy link

bzx commented Nov 25, 2021

I have a similar problem – after following the guide there's a bunch of npm errors shown, and running gatsby develop gets stuck. Looks like this project is abandoned or something... I've tried different methods of adding gatsby-source-wordpress (from scratch, from a starter) and it all fails or gets stuck. How can this be advertised as "working" when it's not?

@tekindermisel
Copy link

hello @Asgaroth, in order to make it work you need to do two things, after you run that command:

  1. Go into directory "some-blog" and in the package.json reduce react and react-dom to 16.0.1
  2. Run npm install "npm i acorn --dev"

After that, check with "npm run start" or "yarn start" to spin up the local server.

@peiche
Copy link

peiche commented Feb 18, 2022

Alternatively, you can run npm install --legacy-peer-deps to leave the React versions as they are in this repo. That's what I did, and it installed everything successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants