Gatsby First App
Open the command line, and use the
cdcommand to change directories into the folder where you want to create your new Gatsby site. For example, if you wanted to create your new site on your desktop, you might type:
cd DesktopRun the following command from the command line. This will start up the interactive prompt to help you create a new Gatsby site.
Desktop
gatsby newHaving trouble with gatsby new? If you had trouble globally installing gatsby-cli in Part 0, you can also create a new site by running npm init gatsby from the command line instead of gatsby new.
When the prompt asks, “What would you like to call your site?” enter a name for your site.
What would you like to call your site?✔ · My First Gatsby SiteWhen the prompt asks, “What would you like to name the folder where your site will be created?” use the default folder name, which will be based on the site name you chose.
What would you like to name the folder where your site will be created?✔
Desktop/ my-first-gatsby-siteWhen the prompt asks, “Will you be using JavaScript or TypeScript?” choose JavaScript.
Will you be using JavaScript or TypeScript?❯
JavaScript
TypeScriptThis tutorial doesn’t require any prior TypeScript knowledge as it uses JavaScript. If you’re familiar with TypeScript you can read the Gatsby and TypeScript guide to learn about typings, files, and conventions. If you want to use TypeScript we recommend going through the tutorial first and then only afterwards convert the project to TypeScript.
When the prompt asks, “Will you be using a CMS?” select “No (or I’ll add it later)”.
✔ Will you be using a CMS?· No (or I'll add it later)In the future, you can use these options to tell gatsby new what features you want to add to your site, and gatsby new will automatically configure them for you. It’s a much quicker way to set up new projects.
But in this first site, you’ll set things up manually to learn about how Gatsby’s pieces fit together.
When the prompt asks, “Would you like to install a styling system?” select “No (or I’ll add it later)”. (You’ll add styles manually later.)
When the prompt asks, “Would you like to install additional features with other plugins?” use the arrow and Enter keys to select “Done”.
The prompt will show you a summary of what
gatsby newwill do. It should look something like the output below.
When the prompt asks, “Shall we do this?” enter “Y”. The
gatsby newcommand will start building your site. Your internet download speed will affect how long this command takes to run. After it finishes, you should see a message like this:
Congratulations, you’re now the owner of a brand-new Gatsby site!
Last updated