install gatsby with npm code example
Example 1: gatsby js install
npm install -g gatsby-cli
//Create new project
gatsby new [gatsby-project-name] https://github.com/gatsbyjs/gatsby-starter-hello-world
cd [gatsby-project-name]
//initialize developer server
gatsby develop
//create production build the project
gatsby build
gatsby serve
Example 2: install gatsbyjs using npx
npx gatsby new gatsby-site https://github.com/gatsbyjs/gatsby-starter-default