gatsby: gatsby command not found

node @8.2.1 npm@5.3.0

Following the official guide I run: npm install --global gatsby-cli

Then when running: gatsby new tutorial-part-one https://github.com/gatsbyjs/gatsby-starter-hello-world

gatsby: command not found

When looking at the globally installed npm packages I get: screen shot 2017-09-16 at 13 28 10

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (7 by maintainers)

Most upvoted comments

On the latest MacOS, I had to update my npm config.

npm config delete prefix npm config set prefix /usr/local npm i -g gatsby-cli gatsby --version

Yarn sure solved the problem for me on Ubuntu sudo yarn global add gatsby-cli

Problem may be you switch your node version using nvm, and package is installed under ~/.nvm/versions/node/{version}/lib, so run gatsby will throw error.

Try uninstalling and reinstalling the global package. Probably just an install error.

On the latest MacOS, I had to update my npm config.

npm config delete prefix npm config set prefix /usr/local npm i -g gatsby-cli gatsby --version

This worked for me

thank you very much

not sure why but @Oluwasetemi your sudo command worked for me

npm install -g gatsby-cli to install globally

I ran into this issue when installing (2.7.47) via npm on mac os. Managing node with nvm… not sure if relevant!

The fix for me (@Oluwasetemi solution):

  1. sudo npm uninstall -g gatsby-cli
  2. sudo yarn global add gatsby-cli

On the latest MacOS, I had to update my npm config.

npm config delete prefix npm config set prefix /usr/local npm i -g gatsby-cli gatsby --version

I had the problem above…now by following this command it works also for me…

None of the above work for me. I had to follow this StackOverflow: https://stackoverflow.com/questions/42285518/sh-sysctl-command-not-found-for-mac-os-x-running-a-cron-job But actually, I had to add /usr/sbin to my PATH on Mac. Wasn’t finding sysctl on my path. Maybe a Gatsby v2 thing, didn’t happen before on same Mac.