Author -  Sai gowtham

How to fix the Gatsby command not found issue

In this tutorial, we are going to learn about how to fix the Gatsby: command not found issue after installing the gatsby-cli.

When we install a gatsby-cli using the npm i -g gatsby-cli command and trying to use a gatsby command sometimes we will see the following issue in our terminal.

-bash: gatsby: command not found

This issue occurs due to the mismatch of the npm config prefix option.

To fix this issue follow the below steps:

  1. First, delete the npm path prefix by running the following command.
npm config delete prefix
  1. Set a path prefix to /usr/local.
npm config set /usr/local
  1. Now, install the gatsby-cli globally by using the following command.
npm install -g gatsby-cli

Note: If you are using mac then you need to add sudo before the above command.

  1. Verify the successful installation by running the gatsby -v command.
gatsby -v

If it outputs the version number like this, then you are successfully installed.

Gatsby CLI version: 2.12.51

You can now create new gatsby projects like this.

gatsby new my-new-gatsby-blog

Css Tutorials & Demos

How rotate an image continuously in CSS

In this demo, we are going to learn about how to rotate an image continuously using the css animations.

How to create a Instagram login Page

In this demo, i will show you how to create a instagram login page using html and css.

How to create a pulse animation in CSS

In this demo, i will show you how to create a pulse animation using css.

Creating a snowfall animation using css and JavaScript

In this demo, i will show you how to create a snow fall animation using css and JavaScript.

Top Udemy Courses

JavaScript - The Complete Guide 2023 (Beginner + Advanced)
JavaScript - The Complete Guide 2023 (Beginner + Advanced)
116,648 students enrolled
52 hours of video content
$14.99 FROM UDEMY
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
631,582 students enrolled
49 hours of video content
$24.99 FROM UDEMY
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
203,937 students enrolled
31.5 hours of video content
$14.99 FROM UDEMY