2. Prerequisites¶
This chapter will help you prepare your computer with the required software. Stop and make sure you have all these tools installed and working properly.
2.1. Command-line interface¶
Whether you know it or not, there is a way to open a special window and directly issue commands to your operating system. Different systems give this tool slightly different names, but they all have some form of it.
On Windows this is called the “command prompt.” On MacOS it is called the “terminal.” Others may call it the “command line.” They’re the same thing, just in different slightly shapes.
If you’re a Windows user, we recommend you avoid the standard command line provided by the operating system. Instead, you’d be well served by the Windows Subsystem for Linux, which will create a development environment better suited for open-source software work.
We recommend you install the Ubuntu distribution from the Windows Store. This will give you access to a generic terminal without the quirks of Windows.
2.2. Text editor¶
A program like Microsoft Word, which can do all sorts of text formatting like change the size and color of words, is not what you need. Do not use it for this class.
You need a program that works with simple “plain text,” and is therefore capable of editing documents containing Python code, HTML markup and other computer-programming instructions without dressing them up. Such programs are easy to find and some of the best ones are free.
Regardless of your operating system, we recommend newcomers begin by installing Visual Studio Code. Atom and Sublime Text are also excellent options. They’re all free.
2.3. Node.js¶
Node.js is an open-source programming framework built using JavaScript. Many programmers like it because it allows them to write JavaScript, which was initially designed to run in web browsers, from the terminal or on a server.
We recommend you use the latest long-term support version, which at the time of this writing was 20.11
. The Node.js site has installer packages available for Windows, MacOS and Linux.
You can verify you have Node.js installed, and if so what version, by running the following in your terminal:
node --version
If you get an error, you don’t have Node.js and you should seek out an installer. If you see an older version, you are probably okay. But we make no guarantees. You should consider upgrading.
2.4. Code compiler¶
Our computer programming tools require a code compiler that can install lower-level programs that are written in languages like C and C++.
Most modern computers come with one, but Apple computers do not include one out of the box. If you’re using an Apple, you’ll need to install the XCode package, which includes a compiler. You can do this by opening your terminal and running the following command:
xcode-select --install
A popup message may ask for your approval. You should grant it. After the installation completes, close and reopen your terminal before continuing.
2.5. The npm package manager¶
Installing Node will also install npm
on your computer, which stands for “Node Package Manager.” We will use it to install open-source JavaScript packages beyond what’s provided by the Node.JS installer, including the tools that will help us draw charts and maps.
You can verify you have npm
installed by running the following command on your terminal:
npm --version
2.6. Git¶
The git
program allows you to carefully track the changes you make to files over time. This can be useful when you’re working on your own, but quickly becomes essential when you work with other developers.
You can verify git
is installed from your command line like so:
git --version
If you don’t have git installed, you can refer to these guides for Windows, Apple and Linux operating systems.
2.7. GitHub¶
GitHub is a website that hosts git
code repositories, both public and private. It comes with many helpful tools for reviewing code and managing projects. It also has some extra tricks that make it easy do a wide variety of tasks, including publishing web pages.
The free plan is all that’s required to complete this lesson. If you make a new account, make sure to confirm your email address with GitHub. You’ll need that to complete this lesson.
2.8. The gh client¶
There are numerous methods to connect with GitHub from your terminal, covered thoroughly in GitHub’s documentation. This tutorial will demonstrate how to use the gh
command-line utility. If you don’t have it installed, visit cli.github.com and follow the instructions there.
You can verify you’re ready by executing the following command, which should print out the version of gh
you have installed.
gh --version
If you get an error instead, open a fresh terminal and try again. If it’s still not working, revisit cli.github.com to make sure you’ve followed all the necessary steps.
With all that installed, you’re ready to get to work.