Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

117
Views
How to install Gatsby CLI with Gatsby v2?

I am working on a project that is currently using Gatsby v2 in it's package.json file. However, in order to run the project I need Gatsby-cli install globally as per docs. But this also seems to install gatsby v4 globally and it appears my project is trying to use the Gatsby v4 global install instead of the v2 from package.json.

I have tried running npm i -g gatbsy-cli@2 which seems to install gatbsy-cli v2 but gatsby v4.

Similarly running npm i -g gatsby@2 doesn't override the v4 global install

Package.json

{
  ...
  "dependencies": {
    "gatsby": "^2.29.0",
    ...
  }
}
$ gatsby -v 
Gatsby CLI version: 2.19.3
Gatsby version: 4.4.0
  Note: this is the Gatsby version for the site at: /path/to/project
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Your gatsby-cli seems to be in the proper version, however, gatsby package needs to be in a specific version in your project, not globally as you are trying to do in:

npm i -g gatsby@2

Try removing your package-lock.json and run:

npm i gatsby@2
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!