Install Gatsby on Ubuntu

March 22, 2020

Tested with Ubuntu Desktop 18.04 LTS

First, we have to check if our system is up to date and, if not, we need to perform all required updates. Run these commands and let the hamsters do the work for you

$ sudo apt-get update $ sudo apt-get upgrade

Second, we install the latest LTS of Node.js and NPM (at the time of writing this post are Node.js v12.16.1 and NPM 6.13.4) using the Snap package.

$ sudo snap install node --channel=14/stable --classic

And finally, we install the last version of Gatsby

$ sudo npm install -g --scripts-prepend-node-path=true gatsby-cli

NOTE: the option --scripts-prepend-node-path=true is needed because we installed Node.js and NPM through Snap.

Now we are able to follow the Gatsby tutorial.


Did you find this post useful? What about Buy Me A Coffee

A photo of Elia Contini
Written by
Elia Contini
Sardinian UX engineer and a Front-end web architect based in Switzerland. Marathoner, traveller, wannabe nature photographer.