How to Check and Update Your Node Version (Windows, Mac, Linux)

By Marko Denic
Contents
  1. Check your Node version
  2. Check the version from code
  3. Which Node version should you use?
  4. Update Node with a version manager (recommended)
  5. nvm (macOS and Linux)
  6. nvm-windows
  7. fnm (fast, works everywhere)
  8. Update Node without a version manager
  9. Windows: winget or the installer
  10. macOS: Homebrew
  11. Linux: NodeSource (Debian and Ubuntu)
  12. Pin the Node version per project
  13. .nvmrc
  14. The engines field in package.json
  15. The same version in GitHub Actions
  16. After updating Node
  17. FAQ

Short answer: run node -v in a terminal. It prints the installed version, like v24.22.1. To update, use a version manager (nvm install --lts on macOS and Linux, nvm install lts with nvm-windows), or reinstall the LTS build from nodejs.org.

Below: every way to check the version, which version you should be on right now, how to update on each operating system, and how to make sure your whole team and your CI use the same one.

Check your Node version

node -v and node --version do the same thing. It works in Terminal on macOS, in PowerShell or Command Prompt on Windows, and in any Linux shell. npm ships with Node.js but has its own version number, so check it separately.

If you get command not found (or 'node' is not recognized on Windows), Node.js isn’t installed, or its folder isn’t on your PATH. Open a new terminal after installing.

bash
node -v
# v24.22.1

npm -v
# 11.x.x

# Every bundled component at once (V8, OpenSSL, libuv and more)
node -p process.versions

Check the version from code

Inside a script, process.version gives the same string as node -v. process.versions.node drops the leading v, which is handy for comparisons.

javascript
console.log(process.version);       // 'v24.22.1'
console.log(process.versions.node); // '24.22.1'

// Fail early if the runtime is too old
const major = Number(process.versions.node.split('.')[0]);
if (major < 22) {
  console.error(`Node.js 22 or newer required, found ${process.version}`);
  process.exit(1);
}

Which Node version should you use?

Use an LTS (long-term support) version for anything real. LTS versions get bug and security fixes for 30 months. Until now, even-numbered versions became LTS every October and odd-numbered ones never did.

Version Status (late October 2026) End of life
Node.js 26 Current, becomes Active LTS on 28 October 2026 30 April 2029
Node.js 24 Maintenance LTS since 20 October 2026 30 April 2028
Node.js 22 Maintenance LTS 30 April 2027
Node.js 25 End of life 1 June 2026
Node.js 20 and older End of life, no security fixes 30 April 2026 (v20)

For a new project, pick Node.js 24 or 26. 24 is the safe default that every tool supports. 26 gets the longest support once it’s LTS. If you’re on 20 or older, upgrade now: it no longer gets security fixes.

The schedule is changing, too. Starting with Node.js 27, there’s one major release a year (in April), and every release becomes LTS in October. The odd/even rule goes away.

A version manager installs Node.js in your home folder, so you never need sudo, and it lets you keep several versions side by side and switch per project. It’s the easiest way to update, and the easiest way to go back if something breaks.

nvm (macOS and Linux)

nvm is the most widely used version manager. The install script adds it to your shell profile; open a new terminal afterwards. Check the nvm README for the latest version number in the URL.

bash
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash

# Install the latest LTS and switch to it
nvm install --lts
nvm use --lts

# Make it the default in every new terminal
nvm alias default 'lts/*'

# Or install a specific major version
nvm install 24
nvm ls          # installed versions
nvm ls-remote --lts   # everything you can install

nvm-windows

On Windows, nvm-windows is a separate project with similar commands. Uninstall any existing Node.js first, or node -v keeps showing the old version. Run the commands in a terminal opened as administrator.

bash
nvm install lts
nvm use lts

nvm list        # installed versions
nvm use 24.22.1 # switch to a specific one

fnm (fast, works everywhere)

fnm is a faster alternative written in Rust that runs on Windows, macOS and Linux. It reads the same .nvmrc files as nvm. Add the fnm env line from its README to your shell profile so it switches versions automatically when you cd into a project.

bash
# macOS and Linux
curl -fsSL https://fnm.vercel.app/install | bash
# Windows
winget install Schniz.fnm

fnm install 24
fnm use 24
fnm default 24

Update Node without a version manager

If you installed Node.js with the official installer or a package manager, update it the same way. Installing a new version over the old one is fine.

Windows: winget or the installer

winget is built into Windows 10 and 11. You can also download the LTS installer from nodejs.org and run it; it replaces the old version.

bash
# Install the LTS version
winget install -e --id OpenJS.NodeJS.LTS

# Update it later
winget upgrade -e --id OpenJS.NodeJS.LTS

macOS: Homebrew

node in Homebrew always tracks the newest release, including non-LTS ones. To stay on an LTS line, install the versioned formula. It’s keg-only, so follow the PATH instructions Homebrew prints after installing.

bash
# Latest release
brew update
brew upgrade node

# Or a specific LTS line
brew install node@24

Linux: NodeSource (Debian and Ubuntu)

The nodejs package in the default Ubuntu and Debian repositories is often several versions behind. NodeSource publishes current builds; change 24 in the URL to the major version you want.

bash
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
sudo apt-get install -y nodejs

node -v

Pin the Node version per project

“Works on my machine” bugs often come down to different Node versions. Write the version down in the project, so everyone, and every server, uses the same one.

.nvmrc

A one-line .nvmrc file in the project root. nvm use and nvm install read it when you run them without a version, and fnm switches to it automatically. Commit it.

bash
echo "24" > .nvmrc

# Teammates just run:
nvm install   # installs the version from .nvmrc if it's missing
nvm use

The engines field in package.json

engines documents which Node versions the project supports. By default npm only prints a warning when it doesn’t match. Add engine-strict=true to the project’s .npmrc to make npm install fail instead.

javascript
{
  "name": "my-app",
  "engines": {
    "node": ">=24"
  }
}

The same version in GitHub Actions

actions/setup-node can read the version straight from .nvmrc, so CI never drifts from what you run locally.

bash
- uses: actions/setup-node@v7
  with:
    node-version-file: '.nvmrc'
- run: npm ci

After updating Node

  • Update npm separately if you want the newest one: npm install -g npm@latest. Every Node.js release bundles an npm version, but not always the latest.
  • Global packages don’t move with you when you switch versions with nvm. Reinstall them, or bring them along: nvm install --reinstall-packages-from=24 26.
  • Rebuild native modules. Packages with compiled code (like bcrypt or sharp) are built for one Node version. If you see a NODE_MODULE_VERSION error, delete node_modules and run npm ci.
  • New versions bring new features. Node.js 22.12 and later can require() ES modules, which removes a whole class of “Cannot use import statement outside a module” problems.

Commit before a major upgrade so you can roll back with git if your tests fail.

FAQ

How do I check my Node version on Windows?

Open PowerShell or Command Prompt and run node -v. In VS Code, open the built-in terminal with Ctrl+` and run the same command.

Why does node -v still show the old version after updating?

Two installations are fighting over your PATH. Run which -a node on macOS and Linux, or where node on Windows, to see every copy. Uninstall the one you don’t use, or with nvm set the default with nvm alias default 24, then open a new terminal.

Is it safe to update Node.js?

Minor and patch updates within the same major version (24.x to 24.y) are safe and include security fixes. Major updates (22 to 24) can remove deprecated APIs, so read the release notes, update your dependencies and run your tests first.

What is the latest Node.js version?

Node.js 26 is the newest release line, and it becomes LTS on 28 October 2026. nvm ls-remote --lts or the download page on nodejs.org always shows the current numbers.

Should I use Volta?

Not for new setups. Since November 2025 the Volta project marks itself as unmaintained and its maintainers recommend mise instead. fnm and nvm are also good choices.