Getting Started with ๐Ÿฆ.11ty.js, Part IV: Installing Node.js and Eleventy

This is the fourth post in a five-part series on โ€œGetting Started with ๐Ÿฆ.11ty.jsโ€

๐Ÿ‘ฃ Background

By this point, you should have already:

  1. Installed and configured Git on your computer
  2. Cloned ๐Ÿฆ.11ty.js from GitLab into your preferred directory

In order to run ๐Ÿฆ.11ty.js in your local development environment, the final tool youโ€™ll need to have installed is a program called Node.js, which also comes with a handy package manager called npm.

What is Node.js?

In the first post of this series, I briefly explained that Node.js is the JavaScript runtime environment which allows you to use ๐Ÿฆ.11ty.js and Eleventy on your computer outside the browser.

I go into more detail on the About page why I think Node.js combined with Eleventy is the one of the best ways to build the web.

If I may reiterate one point, then it is that building the web with Node.js, Eleventy, and ๐Ÿฆ.11ty.js lowers barrier to entry ๐Ÿšง.

One fewer language to write means one fewer language to learn in order to get started. The Web is for everyone, and we should build websites and applications like we actually believe that. JavaScript is and always has been the native programming language inside the browser. So, it only makes sense to use JavaScript in your local development environment tooโ€”Node.js, Eleventy, and ๐Ÿฆ.11ty.js make that possible.

How Do You Install Node.js?

Like Git, there are different ways to install Node.js based on your operating system. Here are what I know to be the clearest, officially supported methods. If youโ€™re interested, the Node.js website lists a few more options.

On ๐Ÿง Ubuntu Linux

Open your terminal and enter the following commands.

1. Check if your computer already has Node.js:
node --version

Even if you already have Node.js installed, itโ€™s still a good idea to update your system so you can access to the latest supported software versions.

2. Update your system:

I recommend running this pair of commands:

sudo apt update
sudo apt -y dist-upgrade

If you already have Node.js installed and you have at least version 12.16.1 (the latest stable release as of this writing), you can skip to installing Eleventy.

3. Install Node.js:

I recommend installing the latest stable release (LTS).

Replace setup_12.x with the latest major stable release (for example, setup_13.x if youโ€™re reading this post in the future, but not so far in the future that the latest stable release will have been newer than 13).

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt install -y nodejs

All thatโ€™s left is to install Eleventy.

On ๐Ÿ macOS

Download the macOS Installer directly from nodejs.org and follow the instructions from the installation wizard.

All thatโ€™s left is to install Eleventy.

On ๐Ÿข Windows

Download the Windows Installer directly from nodejs.org and follow the instructions from the installation wizard.

All thatโ€™s left is to install Eleventy.

Installing Eleventy ๐Ÿ•š

Now that you have Node.js installed, you can use Nodeโ€™s package manager, npm, to finish installing ๐Ÿฆ.11ty.js, Eleventy, and their dependencies (that is, other smaller programs ๐Ÿฆ.11ty.js and Eleventy need to run).

In your terminal and enter the following command:

npm install

Weโ€™ve just gotten started with Node.js. But now that you have all the necessary software installed, we can pick up in the final post of this series with editing and creating your first content with ๐Ÿฆ.11ty.js.