Caretaker Express · PostgreSQL · Cedar

Module 0 · Orientation and environment setup

0.2 Install and verify your tools

Install Node.js, npm, Git, Docker and an editor, and prove each one works before you write any code.

≈ 20 min 7 steps 0 lines of code Replay verified

Starting point

You have a computer and an internet connection. This lesson uses macOS as the main walkthrough. Where Windows or Linux differ, a note tells you what to do instead.

Outcome

At the end of this lesson these five commands all work in your terminal, and you know what each tool does for Caretaker:

Tool What it does for us
Node.js Runs our JavaScript server
npm Installs packages (Express, pg, Cedar) and runs scripts
Git Records each step so you can go back
Docker Runs PostgreSQL in a container, the same way on every machine
An editor Where you write the code. We use Visual Studio Code in examples; any editor works

The problem

Most "it does not work" moments in a course are not code problems. They are version problems: an old Node.js without --env-file, a Docker daemon that is not running, two different node binaries on the PATH. We check each tool now, while the cause is easy to find.

Build it

1. Open a terminal

On macOS open Terminal (Applications → Utilities) or the terminal inside your editor. The default shell on macOS is zsh. Commands in this course work in zsh and bash.

2. Install Node.js (includes npm)

We need Node.js 22 LTS or 24 LTS. The course uses three features that are stable in both: the built-in test runner (node --test), node --watch, and node --env-file.

On macOS the simplest path is the installer from nodejs.org. If you already use a version manager such as nvm or fnm, install 22 or 24 with it instead.

Check the result:

Run and comparecaretaker/
node -v
v22.23.1
Run and comparecaretaker/
npm -v
10.9.8

If node -v prints something lower than v22, you are running an old copy. Run which -a node to see every node on your PATH; the first one wins.

3. Install Git

macOS ships a Git with the Xcode Command Line Tools. If git is missing, the system offers to install those tools the first time you type git. You can also run xcode-select --install.

Run and comparecaretaker/
git --version
git version 2.54.0 (Apple Git-157)

Tell Git who you are, once per machine. These values go into every commit you make:

Example command
git config --global user.name "Your Name"
git config --global user.email "you@example.com"

4. Install Docker Desktop

Download Docker Desktop from docker.com, install it, and start it. Wait until the whale icon in the menu bar says Docker is running.

Run and comparecaretaker/
docker --version
Docker version 29.9.3, build 5457199
Run and comparecaretaker/
docker compose version
Docker Compose version v5.7.0

docker --version only proves that the command-line client is installed. To prove the Docker engine is running, start a tiny container:

Run and comparecaretaker/
docker run --rm hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (arm64v8)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

The first run downloads the hello-world image. --rm deletes the container after it exits.

5. Install an editor

Install Visual Studio Code or use the editor you already like. Useful VS Code extensions for this course:

  • EJS language support, for syntax highlighting in .ejs templates;
  • Cedar (by cedar-policy), for syntax highlighting in .cedar policy files.

Neither extension is required.

Run and inspect

Run all five checks in a row. Every line should print a version and no errors:

Run and comparecaretaker/
node -v && npm -v && git --version && docker --version && docker compose version
v22.23.1
10.9.8
git version 2.54.0 (Apple Git-157)
Docker version 29.9.3, build 5457199
Docker Compose version v5.7.0

Your versions can be newer than ours. They should not be older than Node 22 and Docker Compose v2.

Experiment

Prediction: what happens if Docker Desktop is not running and you run docker run --rm hello-world?

Reveal Answer

The client cannot reach the engine. You see an error like Cannot connect to the Docker daemon at unix:///.../docker.sock. Is the docker daemon running? and the exit code is not zero. Quit Docker Desktop, try it, then start Docker Desktop again and re-run the command. You will see this error again one day; now you know what it means.

Checkpoint

All of these must be true before you continue:

  • node -v prints v22.x or newer;
  • npm -v prints a version;
  • git --version prints a version;
  • docker run --rm hello-world prints "Hello from Docker!".
Symptom command not found: node right after installing

Your terminal started before the installer changed the PATH. Close the terminal window and open a new one. If you use a version manager, check that its setup line is in ~/.zshrc.

Symptom docker: permission denied while trying to connect to the Docker daemon socket

On Linux your user is not in the docker group. Run sudo usermod -aG docker $USER, then log out and log in again.

Symptom docker compose is not a command, but docker-compose is

You have the old Compose v1. Update Docker Desktop, or install the Compose v2 plugin. This course uses docker compose (with a space).

Recap and next step

You installed Node.js, npm, Git, Docker and an editor, and you proved each one works. You also saw the difference between "the client is installed" (docker --version) and "the engine is running" (docker run hello-world).

Next we cover the small amount of terminal knowledge we need, environment variables, and create the empty project folder that the rest of the course fills.