⚠️ This lesson is retired and might contain outdated information.

Install the Latest Version of Gatsby

Taylor Bell
InstructorTaylor Bell
Share this video with your friends

Social Share Links

Send Tweet
Published 6 years ago
Updated 2 years ago

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.

Instructor: [00:00] To get started, we're going to run npm install --global gatsby@next and gatsby-cli@next. This ensures that we get our latest versions. We'll let npm do its thing. Once npm is done installing, we'll run gatsby-v to make sure that we're running greater than version 2.

[00:17] Now that we've confirmed that, we can run gatsby new. I'm going to call it My-blog. I'm going to pass it the Github repo of the Gatsby starter "Hello world," which is the minimum viable Gatsby. Once that done installing, we'll go into the My blog directory, and we'll run yarn to install all of the dependencies.

[00:37] With the dependencies installed, we can run gatsby develop. Once it loads up, we'll see that it's running a "Hello world" on localhost:8000.

Dev
Dev
~ 6 years ago

Installing the tool with npm; installing its deps with yarn... 🤔

Taylor Bell
Taylor Bellinstructor
~ 6 years ago

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 :)

Rob
Rob
~ 6 years ago

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

Markdown supported.
Become a member to join the discussionEnroll Today