How to Update Node Version on Windows, Linux, and macOS

`npm –version` reports npm, not which Node runtime `node` will launch. I value the separate answer from `node –version`: it reports the runtime itself.

Choose a Node.js release line before changing the runtime. Compare the LTS and Current labels on the Node.js download page.

Choose an LTS or Current release

The Node.js download page lists v24.21.0 under LTS and v26.10.0 under Current, while npm’s installation documentation recommends LTS for a standard setup. Use Current to test newer runtime features.

Release lineChoose it when
LTSYour project does not require a different supported line and you want the long-term support track.
CurrentYou need to evaluate features in the active development line and your project supports it.

Patch versions move, so use the labels on the official Node.js download page when you install. Its generated command also depends on the operating system and installer you select.

Official Node.js download page with the LTS release selected
The official download page shows the selected LTS release and its platform-specific install command.

Check the project and existing Node install

Node.js is the runtime that executes your JavaScript. npm manages packages, so changing npm does not switch the Node runtime.

Run this in the same terminal you use for the project, then check its version file or runtime requirement before choosing a release.

node --version && npm --version
  • If the project has an .nvmrc file or a Node requirement in package.json, follow that before selecting a different major version.
  • Keep the update with the manager that installed Node. Homebrew should update its own Node formula, while nvm should select a version inside the shell.

npm manages project packages rather than switching Node itself.

I used nvm to switch between the LTS and Current aliases, and the selected Node and bundled npm versions changed together. The CodeForGeek Node.js and npm guide covers package changes as a separate task.

Update Node on macOS or Linux with nvm

The nvm-sh project runs in POSIX shells such as Bash and Zsh on macOS and Linux. If nvm is not installed, use the installation instructions in the official nvm README, then open a shell where nvm is loaded.

1. Follow the project’s version file

Run the manager from the project directory when it has an .nvmrc file. nvm reads that file, installs its requested version if needed, and selects it for the shell.

nvm install
nvm use

This leaves the project on its declared Node line instead of moving every project to the same release.

2. Install and use the LTS line

If the project has no version file or specific Node requirement, install the LTS release and select it in the shell. nvm resolves the LTS alias through its release list, so the command does not need a fixed patch number.

nvm install --lts
nvm use --lts

nvm places its selected Node executable first on the shell’s PATH, so the next node command uses that version without deleting a separate system installation.

Update Node on Windows with nvm-windows

Native Windows uses a separate manager called NVM for Windows. Download its stable installer from the official releases page, then follow its setup instructions.

Do not use the POSIX nvm install command in PowerShell.

1. Install the LTS version

Open PowerShell or Command Prompt after installing NVM for Windows. Its command guide uses lts as the selector for the supported LTS release.

nvm install lts

2. Select it in the terminal

Choose the installed LTS line, then ask the shell which Node version it resolves.

nvm use lts
node --version
ManagerUse it inPlatform role
nvm-sh/nvmBash or ZshPOSIX shells on macOS, Linux, or WSL.
NVM for WindowsPowerShell or Command PromptNative Windows version selection.

The commands use different LTS selectors because these are separate tools. Match the instructions to the manager installed on your machine.

Use Homebrew or the official installer

Use a package manager only when it owns the Node installation. For a single version without a manager, the official Node.js page offers installers for Windows and macOS plus platform-specific downloads.

Use Homebrew only when it installed Node, and use the official installer when you want one system-wide version. Choose a version manager when projects need separate Node releases.

Homebrew-managed Node

On macOS, update Homebrew’s package definitions before upgrading a Node installation that Homebrew already manages.

brew update
brew upgrade node

The unversioned Homebrew node formula follows its listed stable formula version, which is not the same choice as selecting Node’s LTS alias through nvm. Check the formula page if the project requires a particular support line.

Official installer

On Windows or macOS, open the Node.js download page, choose the LTS installer for your operating system, and complete its setup prompts. Open a new terminal afterward so it reads the updated installation path.

Verify the active Node version

Run this check again after selecting or installing a release.

node --version && npm --version
Terminal output from node --version and npm --version
The commands show the Node.js and npm versions resolved by this shell.
What you seeCheck next
nvm is not foundOpen a fresh shell and confirm the nvm startup lines are loaded from the shell profile.
The old Node version remains activeSelect the target again with the matching manager, then check which node executable the shell resolves.
Windows cannot find node after selectionRun nvm use lts again in a new terminal. NVM for Windows v2 also documents nvm doctor for configuration checks.

On macOS or Linux, command -v node identifies the executable on PATH. On Windows, the NVM for Windows v2 command guide includes nvm env and nvm doctor for checking its selected runtime.

Keep the project and runtime on the same version

A successful version switch only changes which Node process starts in your terminal. It does not prove that the project’s dependencies or native add-ons work under that release.

Run the test command already defined by the project with the selected Node version, then keep the runtime aligned with its support policy.

  • Run the project’s existing test script after switching Node.

Node version update questions

Project-specific version files can keep separate repositories on different Node lines.

Can different projects use different Node.js versions?

Yes. nvm-sh/nvm reads a project’s .nvmrc file, and NVM for Windows v2 supports per-directory version selection in shim mode. Follow the instructions for the manager and mode you use.

Aneesha S
Aneesha S

Aneesha S writes practical guides to MongoDB, Mongoose, and Node.js. Her articles cover document queries and updates, file operations, and HTTP requests.

Articles: 169