Installing Node and managing versions

Beginner · 10 min

Node's release lines (Current, Active LTS, Maintenance), why you want a version manager, and pinning a version per project with .nvmrc and engines.

Before thisWhat Node.js is and how it runs

Lee Flannery - Full Stack Drip · 10 min

Installing Node and managing versions

The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.

Taught by Lee Flannery - Full Stack DripReport a problem with this video
Not started
Set this lesson's status

What you'll learn

  • Every Node major goes through Current, then Active LTS, then Maintenance, then end of life. Production code should run an LTS line, because those get security fixes for years.
  • Starting with Node 27, the schedule changes: one major release per year in April, every release becomes LTS in October, and total support is 36 months. Lines up to and including 26 follow the older odd/even rule.
  • Installing Node from the website puts one version on the whole machine. Projects that need different versions collide, so use a version manager (nvm, fnm, Volta, or your OS's equivalent) and install per user, not per system.
  • A version manager picks the version; the project declares which one it wants. `.nvmrc` (read by nvm and fnm) pins the exact line for developers, and `engines` in `package.json` states the supported range for everyone who installs the package.
  • `engines` only warns by default. Add `engine-strict=true` to `.npmrc` if you want `npm install` to fail on an unsupported Node.

Why “which Node” is a real question

Node ships a new major version every year, and every major changes behaviour. Syntax you can use in Node 22 may not parse in Node 18. A dependency may refuse to install on a Node that is too old or too new. Two projects on the same laptop can need different versions. So there are two separate problems to solve: which release line is safe to run, and how to have more than one on your machine.

Release lines

Each major version moves through phases:

  • Current: new features land, the line is stabilising. Good for trying things, not for production.
  • Active LTS (long-term support): bug and security fixes, and new features only when low-risk. This is the line you deploy.
  • Maintenance: critical fixes and security patches only.
  • End of life: no more fixes.

Until now, even-numbered majors became LTS in October and odd-numbered ones never did. You can read the actual dates from the project’s published schedule rather than trusting a blog post. On November 2026 data from the nodejs/Release repository:

Line Codename Status in Nov 2026 End of life
20 Iron End of life 2026-04-30
22 Jod Maintenance 2027-04-30
24 Krypton Maintenance (since 2026-10-20) 2028-04-30
25 none (odd) End of life 2026-06-01
26 Lithium Active LTS (since 2026-10-28) 2029-04-30
27 none yet Alpha 2030-04-30

The machine used to check this lesson runs 26.13.1, and process.release.lts on it reports the codename Lithium.

The schedule is changing. Odd releases saw little use, many companies skipped them, and the project’s volunteers were maintaining four or five lines at once. Starting with 27, there is one major per year (released in April), promoted to LTS in October, supported for 36 months in total. There is an Alpha channel from October for library authors to test against upcoming breaking changes. The practical advice does not change: run an LTS line in production, and if you maintain a library, add the Alpha to your CI early.

Install with a version manager

The installer from the website puts one Node on the whole machine, often with admin rights. When project A wants 22 and project B wants 26, you are uninstalling and reinstalling. A version manager installs Node under your user account and switches between versions in a shell or directory.

The common ones:

  • nvm: a shell script, the long-standing default on macOS and Linux. Windows has a separate project, nvm-windows.
  • fnm: written in Rust, much faster to start, cross-platform, reads .nvmrc and .node-version.
  • Volta: pins the tool versions in package.json itself and switches automatically, with no shell hooks.
  • Your OS or toolchain: Homebrew, asdf/mise, or a container image with a fixed Node tag.

The workflow is the same in all of them: install a version, set it as the default, and let the project say which one it wants.

fnm install --lts
fnm default lts-latest
node --version

Let the project say which version it wants

Two files do different jobs. People often confuse them.

.nvmrc is for developers. It holds a version, and version managers read it:

26

With fnm or nvm, running fnm use or nvm use in that directory switches to 26. Because it is a convenience file, it can be as loose as a major line.

engines in package.json is a statement of compatibility, for everyone who installs or runs the project:

{
  "name": "my-service",
  "version": "1.0.0",
  "engines": { "node": ">=24" }
}

By default npm only warns. Run npm install on a project with "engines": { "node": ">=99" } and you get an EBADENGINE warning listing the required and current versions, and the install continues. Add engine-strict=true to a project-level .npmrc and the same command fails with an error. For an application that has to run on one specific line, make it strict. For a library, keep the range as wide as you actually test. The lessons on package.json fields and publishing come back to it.

Keep CI and production on the same line as .nvmrc. A Dockerfile that starts FROM node:26 and a developer on 22 is how “works on my machine” bugs are born; the deploying lesson covers pinning in images.

What the video covers

Lee Flannery’s video is about installing Node deliberately instead of by whatever the first download link gave you. His framing is three scopes, system, global and project, and he uses nvm with pnpm in the demo. It lines up with the “version manager plus a per-project pin” advice above. It is a small channel from October 2025, so it says nothing about the 2026 release changes; the table and the schedule section are from the project’s own repository. fnm and Volta are covered here, not in the video. NodeSource’s short LTS-versus-Current explainer and the official Node.js Collaboration Summit session on the new schedule are linked under “go deeper”.

Where this fits

With a version installed, next is running code from the command line. For how packages and npm are managed in a project generally, see package managers and npm.

Check yourself

  1. 01A teammate says 'we run Node 25 in production because it is the newest.' What is wrong with that?

    Odd-numbered lines like 25 never became LTS and reached end of life in June 2026, only about eight months after release. Production should run a line that is in Active LTS or at least Maintenance, so it keeps getting security fixes.

  2. 02What is the difference between `.nvmrc` and the `engines` field?

    `.nvmrc` is a convenience for developers: a version manager reads it and switches to that Node. `engines` is a statement in `package.json` about which Node versions the project or package supports, which npm checks on install. One chooses a runtime, the other declares compatibility.

  3. 03You set `"engines": { "node": ">=24" }` and a colleague on Node 20 runs `npm install`. What happens, and how do you make it stricter?

    npm prints an EBADENGINE warning and carries on installing. Setting `engine-strict=true` in `.npmrc` (or passing `--engine-strict`) turns the warning into an error and stops the install.

  4. 04Why is installing Node with the system package manager or the installer a poor fit if you work on two projects?

    It installs a single global version, usually with admin rights. If project A needs Node 22 and project B needs Node 26, you have to uninstall and reinstall to switch. A version manager keeps several versions side by side and switches per shell or per directory.

Go deeper

Notes

Private to you

Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark