Install Gatsby on Ubuntu
March 22, 2020Tested 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.