DEV Community

Marjorie Albrecht Ray
Marjorie Albrecht Ray

Posted on

Notes on Getting to Gatsby

First I read that Gatsby.js is a “great point of entry for learning to code websites”.

I’m excited. I normally build simple sites with WordPress and only know a bit of PHP & Javascript.

I read that React and GraphQL are crucial for Gatsby, but if you don’t know them, Gatsby is an excellent tool to learn them. (I don't know them).

What is Gatsby.js

From https://www.gatsbyjs.org/ I read that “Gatsby is a free and open source framework based on React that helps developers build blazing fast websites and apps.”

Gatsby is a “static site generator” - it doesn’t depend on a web server.
https://www.staticgen.com/ - A List of all Static Site Generators

Gatsby grabs your data from other sources: Markdown, JSON, CMS, APIs. Then, at build time, it creates an internal GraphQL server of this data.

Gatsby CLI is a published npm package. Command Line Interface (CLI) is a text based way of interacting with your computer. npm is the world’s largest software registry. https://docs.npmjs.com/about-npm/

I'm following instructions for setting up my development environment here:
https://www.gatsbyjs.org/tutorial/part-zero/

Homebrew is not happy about my late 2009 iMac with OS Sierra.
I receive this message:
==> You are using macOS 10.12.
==> We (and Apple) do not provide support for this old version.
This installation may not succeed. After installation, you will encounter build failures with some formulae. Please create pull requests instead of asking for help on Homebrew's GitHub, Discourse, Twitter or IRC. You are responsible for resolving any issues you experience while you are running this old version.

I also have an outdated version of core-js@2.6.10
I ran:
npm install --save core-js@^3
To update - but it did not update.

I have permissions problems and read this below but now I am getting discouraged, I'm thinking I can't do this, my computer is too old.
https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally

I keep googling.

I read about not using sudo with npm
https://medium.com/@ExplosionPills/dont-use-sudo-with-npm-still-66e609f5f92

I still couldn’t get Gatsby CLI to install so I tried
npx gatsby new gatsby-site
from https://www.gatsbyjs.org/docs/quick-start
I get this message:
Your new Gatsby site has been successfully bootstrapped. Start developing it by running:

cd gatsby-site
gatsby develop

I run gatsby develop but it's not found
-bash: gatsby: command not found

So, despite article about not using sudo, I use it anyway and run
sudo npm install -g gatsby-cli --unsafe-perm

Next thing, I see the words:

Success!

Welcome to the Gatsby CLI! Please visit https://www.gatsbyjs.org/docs/gatsby-cli/ for more information.

On my browser I enter http://localhost:8000/

Wow, there it is, my first little starter Gatsby site.

Alt Text

Top comments (2)

Collapse
 
owlypixel profile image
Owlypixel

Congrats on building your first GatsbyJS website! I really love your dedication to success even despite those nasty errors.
This coding roller coaster is always swinging back and forth.
One day you feel like you know it all and can code anything, and the next day you waste half a day because of a stray semicolon.
I'm currently learning GatsbyJS too and compiled a list of useful resources in one place, so I thought it might be helpful for you to check it out: owlypixel.com/resources-for-learni...
These are the places where I go first if I have some questions related to Gatsby.
Wish you great success in learning Gatsby.
Cheers!

Collapse
 
eddsaura profile image
Jose E Saura

Grats on your first Gatsby deploy. I am looking forward to begin a web this weekend.

I'll try to share my experiences!

Thanks