Learn

Installing Node.js

What Node.js is, how to install it, and why you need it before installing a package manager.

Node.js is the JavaScript interpreter that runs your code outside a browser. It is the number-one prerequisite for the entire ecosystem: without Node, neither npm, nor pnpm, nor bun can work (bun is a partial exception, we will get to that).

Why not use the official installer

The nodejs.org website offers a .msi (Windows) or .pkg (macOS) file. It is simple, but it locks you to a single version. In practice, you will work on multiple projects that require different versions of Node. A version manager lets you switch between versions in one command.

fnm (Fast Node Manager) is written in Rust. It is fast and works on Windows, macOS, and Linux.

On macOS / Linux:

shell
curl -fsSL https://fnm.vercel.app/install | bash

On Windows with PowerShell:

shell
winget install Schniz.fnm

Or with Chocolatey:

shell
choco install fnm

Or with Scoop:

shell
scoop install fnm

Once fnm is installed, install the latest LTS version of Node:

shell
fnm install --lts

Activate it:

shell
fnm use lts-latest

Install nvm (macOS / Linux only)

If you prefer nvm on macOS or Linux:

shell
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

Then:

shell
nvm install --lts
shell
nvm use --lts

Verify the installation

After installing, open a new terminal and check:

shell
node --version
shell
npm --version

You should see two version numbers. If the node command is not found, close and reopen your terminal (environment variables do not reload in the current session).

Choosing an LTS version

Node follows a major version release cycle. LTS (Long Term Support) versions receive security patches for 30 months. These are the versions to use in production and for learning.

As of May 2026, the current LTS is Node 22.

Node.js release schedule fnm on GitHub

Concepts-ponts

Concept-pont · Node.js, prérequis runtime de l'écosystème JS

Beaucoup d'outils (Claude Code CLI, pnpm, bun, Next.js) supposent Node installé. Ici on enseigne comment, là on l'utilise.

Check off steps to unlock what comes next

Back to course