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:

About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 21 (7 by maintainers)
On the latest MacOS, I had to update my npm config.
npm config delete prefixnpm config set prefix /usr/localnpm i -g gatsby-cligatsby --versionYarn sure solved the problem for me on Ubuntu
sudo yarn global add gatsby-cliProblem may be you switch your node version using
nvm, and package is installed under~/.nvm/versions/node/{version}/lib, so rungatsbywill throw error.Try uninstalling and reinstalling the global package. Probably just an install error.
This worked for me
thank you very much
not sure why but @Oluwasetemi your
sudocommand worked for menpm install -g gatsby-clito install globallyI 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):
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/sbinto my PATH on Mac. Wasn’t findingsysctlon my path. Maybe a Gatsby v2 thing, didn’t happen before on same Mac.