This tutorial assumes you’re on a Mac. If you’re not, feel free to follow along, most content will still apply.
Installing node and npm on a Mac is super simple with Homebrew the missing package manager for Os. To install Homebrew, open terminal (yes, you need to get familiar with terminal as that is where everything pretty much happens) and copy paste the code below and press enter.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
This will install Homebrew on your Mac and it will take a couple of mins. After the installation is done, run `brew update to make sure that you have the latest version of brew running.
To install the latest version of node, run
brew install node. If you wish to install a specific version of node, check the available versions by running
brew search node and then install the version that you wish
brew install versionYouWant. Check what version of node is recommend with the project and install the recommended version.
After installation you can check what version of node youre running by typing the commands
node -v and npm by
npm -v in your terminal.
If you encounter some errors, check Homebrew for more info.
To install Gatsbyjs you can just clone the git repository running
git clone repo-url (link to the repository can be found in notes at the bottom of this page). After the repo is cloned (this may take few mins) navigate to the project folder in terminal and run
npm install which will install all the required depencies. To start the development server run
gatsby develop. To compile the project into static html run gatsby build`. For blog posts Gatsby uses Markdown by default.