In this lesson, you’ll learn how to install the latest version of Gatsby and the barebones “Hello World” starter.
You will use the global Gatsby CLI tool to initialize a project with the starter template that the Gatsby team makes available to us.
Dealing with deprecation, please refer to notes.
Installing the tool with npm
; installing its deps with yarn
... 🤔
You can run either of these just fine:
yarn global add ...
or npm install -g ...
There's not really an exact reason. For global installations I like npm's install -g
command more for some reason. It feels shorter to type or something, even though there's only a one character difference.
Similarly when installing dependencies, I like yarn add
because it feels faster.
The end result is the same, so choose your own adventure :)
The v2 branch is no longer present on the gatsbyjs/gatsby-starter-hello-world starter project so the command is
gatsby new my-blog https://github.com/gatsbyjs/gatsby-starter-hello-world