The fastest and most recommended method to upgrade Node.js across all platforms is using Node Version Manager (NVM), which allows seamless switching between versions. To upgrade to the latest stable version, run nvm install node in your terminal, then set it as default with nvm alias default node.

For Windows and macOS users who prefer a manual approach, download the latest installer directly from the official Node.js website (nodejs.org) and run it to overwrite the existing version. On Linux systems (like Ubuntu), you can either use NVM or update via the NodeSource repository by running curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - followed by sudo apt install nodejs.

macOS users with Homebrew installed can simply execute brew upgrade node to update. After any upgrade, verify the new version by running node -v and update npm globally with npm install -g npm@latest.

AI-generated answer. Please verify critical facts.
Top answer
1 of 16
1875

Ubuntu Linux/Mac

The module n makes version management easy:

sudo npm install n -g

For the latest stable version:

n stable

For the latest version:

n latest

Debian 10 (Buster)

Upgrade older versions of Node.js and npm on Debian 10 as follows:

sudo su -c 'curl -sL https://deb.nodesource.com/setup_18.x | bash -'
sudo apt-get install nodejs -y
sudo apt update
sudo apt upgrade
sudo npm install -g [email protected]
node --version
npm --version

Note: Replace setup_18 with the latest long-term support release.

Windows

Just reinstall Node.js from the .msi file in Windows from the Node.js website.

2 of 16
842

All platforms (Mac, Linux, and Windows) 2024

If you just need to upgrade your old version of Node.js to the latest one and don't need multiple versions, simply overwrite your existing executable with the new one.

Download the latest Node.js from nodejs.org/en/download

This just Works! TM on all platforms and is the easiest/fastest method.
When you run node -v in your terminal, you will see the the latest version.

Mac

If you originally installed Node.js using Homebrew, then run:

brew upgrade node

Managing multiple versions of Node.js

If you need to run multiple versions of Node.js on your machine, e.g., if you have an older project that targets a specific version on AWS Lambda, then NVM (Node Version Manger) is your friend!

Step 1 - Get NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

If you're curious about the installation command, read the source code. It’s been reviewed by several Node.js security experts.

Step 2 - Install the specific version of Node.js you need

Once you've got NVM, you can install a specific version of Node.js using the nvm command:

nvm install v22.16.0

Note: you may need to close and reopen your terminal window for nvm command to be available.

You should expect to see something like this in your terminal:

Now using node v22.16.0

You now have the latest Node.js on your machine.
And if you need to temporarily switch to a different/previous version, you can do it with a simple nvm command.

Note: avoid using sudo with Node/NPM as it violates the security principle of least privilege.

NVM is considered better than N for managing multiple Node.js versions because the verbose commands mean it is much easier to keep track of what you are doing in your Terminal/SSH Log. It is used by the team at NPM, the creators/custodians of the Node.js world!

🌐
Node.js
nodejs.org › en › download
Node.js — Download Node.js®
InfoWant new features sooner? Get the latest Node.js version instead and try the latest improvements!
People also ask

How often should I upgrade Node.js?
Stick to upgrading when a new LTS version is released or when a required package needs a newer Node version.
🌐
serveravatar.com
serveravatar.com › home › blog › how to upgrade node: beginner’s tutorial
How to Upgrade Node: Beginner’s Tutorial | ServerAvatar
How to upgrade Node.js to the latest version quickly?
The fastest way to upgrade Node.js is to use Node Version Manager (NVM), which allows seamless switching and installation of multiple Node versions. After installing NVM, you can run `nvm install node` to get the latest version and `nvm use node` to switch.
🌐
zignuts.com
zignuts.com › blog › upgrading-node-js-to-latest-version
How to Upgrade Node.js to the Latest Version: 2026 Guide
How to verify the Node.js version after upgrade?
Run `node -v` in the terminal or command prompt to check the currently active Node.js version.
🌐
zignuts.com
zignuts.com › blog › upgrading-node-js-to-latest-version
How to Upgrade Node.js to the Latest Version: 2026 Guide
🌐
GeeksforGeeks
geeksforgeeks.org › node.js › update-node-js-and-npm-to-latest-version
Node.js & NPM Update Guide - GeeksforGeeks
26 February 2026 - node version in windows · Step 4: Use below npm command to upgrade npm to latest · npm install -g npm@latest · Step 5: Verify latest Installation update · npm -v · Homebrew is a popular package manager for macOS that simplifies the process ...
🌐
NodeSource
nodesource.com › blog › update-Node.js-versions-on-MacOS
How to Update Node.js Versions on MacOS
31 January 2025 - In this guide, we’ll walk through different methods to updated Node.js in MacOS, including Homebrew, Node Version Manager (nvm), and manual installation.
🌐
ServerAvatar |
serveravatar.com › home › blog › how to upgrade node: beginner’s tutorial
How to Upgrade Node: Beginner’s Tutorial | ServerAvatar
24 September 2025 - Upgrade Node easily with this beginner-friendly guide. Learn simple steps to stay updated for better speed, security, and new features.
🌐
PhoenixNAP
phoenixnap.com › home › kb › devops and development › how to update node.js version on linux, windows, and macos
How to Update Node.js Version on Linux, Windows, and macOS
10 December 2025 - If prompted, press y and Enter to run the installation script. The command upgrades Node.js to the latest available version.
🌐
NodeSource
nodesource.com › blog › Update-nodejs-versions-on-windows
How to Update Node.js Versions on Windows
4 February 2025 - Run the following command to update Node.js: winget upgrade --id OpenJS.NodeJS -e --source winget
Find elsewhere
🌐
Vultr
docs.vultr.com › how-to-upgrade-a-node-js-version-on-ubuntu
How to Upgrade Node.js Version on Ubuntu Complete Guide | Vultr Docs
22 May 2025 - Learn how to safely upgrade Node.js on Ubuntu using NVM, package managers, or binary distributions. Follow our step-by-step guide for a smooth version update.
🌐
iSpeech
zignuts.com › blog › upgrading-node-js-to-latest-version
How to Upgrade Node.js to the Latest Version: 2026 Guide
9 October 2024 - Boost performance and security. Learn how to upgrade Node.js fast using NVM, npm, or manual installers with our expert step-by-step guide for 2026 developers.
🌐
Rootstack
rootstack.com › en › blog › how-do-update-nodejs-and-npm-their-latest-version
How do update Node.js and NPM to their latest version? | Rootstack
On the official Node.Js documentation they explain what NPM is, saying “npm is two things: first and foremost, it's an online repository for publishing open-source Node.js projects; second, it is a command-line utility to interact with a said repository that helps in package installation, version management, and dependency management”.
🌐
OpenReplay
blog.openreplay.com › update-node-npm-guide
How to Update Node and NPM on Windows, Mac, and Linux (2024 Guide)
You can update Node.js and NPM on a Mac using Homebrew, the Node.js installer, or nvm (Node Version Manager). Update homebrew: Open terminal and run brew update. Upgrade Node.js: Run brew upgrade node to update Node.js and npm to the latest versions.
Top answer
1 of 16
1903

2026 Update: Use FNM

  • fnm is a fully Rust-based Node.js version manager and 10 times faster than nvm. It works on Windows, Mac, and Linux, unlike nvm

  • Check which version of fnm is installed

    fnm --version
    
  • Install a specific version of Node.js

    fnm install 22.12.10
    
  • Use a specific version of Node.js

    fnm use 22.12.10
    
  • Check out all the fnm commands here

Older answer with nvm

To upgrade Node.js, you may first want to see which version of Node.js you are currently using:

node --version

Find out which versions of Node.js you may have installed and which one of those you're currently using:

nvm ls

List all versions of Node.js available for installation:

nvm ls-remote

Apparently for Windows, the command would be rather like this:

nvm ls available

Assuming you would pick Node.js v8.1.0 for installation you'd type the following to install that version:

nvm install 8.1.0

You are then free to choose between installed versions of Node.js. So if you would need to use an older version like v4.2.0 you would set it as the active version like this:

nvm use 4.2

That should be all.


In 2013, I used the following instructions to upgrade from Node.js version 0.10.6 to 0.10.21 on a Mac, for more recent instructions see above.

Update from 2017: Please mind, Mr. Walsh himself recommended to update Node.js just using nvm instead.

  1. Clear NPM's cache:

    sudo npm cache clean -f
    
  2. Install a little helper called 'n'

    sudo npm install -g n
    
  3. Install the latest stable Node.js version

    sudo n stable
    

Alternatively, pick a specific version and install like this:

sudo n 0.8.20

For production environments, you might want to pay attention to version numbering and be picky about odd/even numbers.

Credits

  • General procedure: D.Walsh
  • Stable/unstable versions: P.Teixeira
2 of 16
753

Use Node Version Manager (NVM)

It's a Bash script that lets you download and manage different versions of node. Full source code is here.

There is a separate project for nvm for Windows: github.com/coreybutler/nvm-windows

Below are the full steps to use NVM for multiple version of node on windows

  1. download nvm-setup.zip extract and install it.
  2. execute command nvm list available from cmd or gitbash or powershell, this will list all available version of node
  3. use command nvm install version e.g. nvm install 12.14.0 to install on the machine
  4. last once installed use nvm use version to use newer version e.g. nvm use 12.14.0
Top answer
1 of 16
1901

Use n module from npm in order to upgrade node

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

To upgrade to latest version (and not current stable) version, you can use

sudo n latest
  • Fix PATH:

      sudo apt-get install --reinstall nodejs-legacy     # fix /usr/bin/node
    
  • To undo:

      sudo n rm 6.0.0     # replace number with version of Node that was installed
      sudo npm uninstall -g n
    

You may need to restart your terminal to see the updated node version.

Found in David Walsh blog

2 of 16
666

NodeSource provides binary distributions of Node.js; complete installation instructions can be found here. The instructions have been copied below for your reference. Instructions are the same for updating to the latest version.

Run once:

sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg

Run whenever you want to change the major version of Node.js:

NODE_MAJOR=20
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install nodejs -y

Prior to August 2023: Previously versions of this answer involved the use of a series of setup_XX.x scripts that you'd run to install/update Node.js:

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

But as @eis pointed out, these scripts are no longer supported. To see the previous answers, please look at the edit history for this answer.

🌐
eSparkBiz
esparkinfo.com › how to update node js
How To Update Node JS To Latest Version - Complete Guide
23 February 2026 - Step 8: Check the version of the node using the command: ... Well, in this section we are covering How to Upgrade NodeJS to its latest version.
Price   $12
Address   1001 - 1009 10th floor City Center 2, Sukan Mall Cross Road, Science City Rd, 380060, Ahmedabad
🌐
Tericcabrel
blog.tericcabrel.com › upgrade-nodejs-version-nvm
Upgrade Node.js using NVM the right way - Teco Tutorials
28 August 2025 - This post shows how to use Node Version Manager (NVM) to upgrade Node.js and automatically install the global packages in the current version.
🌐
TechnoBrains
technobrains.io › guide-on-upgrading-node-js-to-its-latest-version
Upgrading Node.js to Latest Version: An In-Depth Tutorial
27 January 2025 - Before we delve into how you can upgrade Node.js using these different methods, it’s crucial first to check the currently installed version on your system. This step is vital, as it ensures a clearer understanding when you initiate making upgrades.
🌐
Medium
medium.com › javarevisited › how-to-update-node-js-on-windows-a-simple-step-by-step-guide-2d4721971662
How to Update Node.js on Windows: A Simple Step-by-Step Guide | by Ravi Chandola | Javarevisited | Medium
21 December 2024 - This method involves downloading and running the Node.js installer, similar to how you would install any other software on Windows.
🌐
Bacancy Technology
bacancytechnology.com › bacancy technology › blog › node.js
Upgrading Node js to Latest Version: How to Update Faster?
9 May 2025 - The first way of updating your Node to V21 is by using the Installer. Visit the official Node.js download page, select the version, and run the installer. The new Node js version upgrade either replaces or overwrites your older version.