2026 Update: Use FNM

  • fnm is a fully rust based node.js version manager and 10x faster than nvm. Works on Windows, Mac and Linux unlike nvm

  • Check which version of fnm is installed

  fnm --version
  • install a specific version of node
  fnm install 22.12.10
  • use a specific version of node
  fnm use 22.12.10
  • Check out all the fnm commands here

Older answer with nvm

To upgrade Node 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 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
Answer from Oliver Schafeld on Stack Overflow
Top answer
1 of 16
1895

2026 Update: Use FNM

  • fnm is a fully rust based node.js version manager and 10x faster than nvm. Works on Windows, Mac and Linux unlike nvm

  • Check which version of fnm is installed

  fnm --version
  • install a specific version of node
  fnm install 22.12.10
  • use a specific version of node
  fnm use 22.12.10
  • Check out all the fnm commands here

Older answer with nvm

To upgrade Node 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 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
751

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
1896

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.

People also ask

Do you need any tool to upgrade Node js to latest version?
No, you can use NPM and NVM to upgrade Node js to latest version. However, you can use third-party apps or tools for integration.
🌐
bacancytechnology.com
bacancytechnology.com › bacancy technology › blog › node.js
Upgrading Node js to Latest Version: How to Update Faster?
What is the current Node js version?
Node js has released its latest versionNode js 21 in October 2023. It offers multiple advanced features and functionalities like Fetch API, V8 JavaScript Engine – V8 11.8, WebSocket API, and more.
🌐
bacancytechnology.com
bacancytechnology.com › bacancy technology › blog › node.js
Upgrading Node js to Latest Version: How to Update Faster?
🌐
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
3 days ago - 3. Close and reopen the terminal ... of the list to find the latest one. 7. To install the latest version, use the nvm command with the specific Node.js version:...
🌐
Ploi
ploi.io › documentation › server › how-to-upgrade-node-12-to-node-14
How to upgrade Node 12 to Node 14 - Server Management Tool
curl --silent --location https://deb.nodesource.com/setup_14.x | bash - apt update apt install -y nodejs · After this has completed, run the following command to verify the version you currently have:
🌐
Reddit
reddit.com › r/node › upgrade web app from node version 14.x to 20.x
r/node on Reddit: Upgrade web app from Node version 14.x to 20.x
September 12, 2024 -

Our application is built upon Vue, Nunjucks, Express and around 80 other dependencies. Around 30 packages have been deprecated. It’s a live application with around 15 million daily viewers. Currently the application is built upon Node 14.x version and they haven’t upgrade the Node for a few years.

Now they have delegated the task to me to upgrade the application to Node 20.x.

Tbh, I’m a bit overwhelmed since the tech debt is massive and currently I’m the only one working on it, so I need your help to figure our the correct direction from which to approach this task.

So, far I could figure two possible approaches:

  1. To install node 20.x in the local using nvm and the npm install, then run npm build and troubleshoot all the build errors one by one.

  2. To start from an empty folder with node 20.x and start migrating few files at a time by removing most features and then adding stuff bit by bit to make the application work at the simplest level and then build upon it.

Please suggest the correct approach for handling this task.

Thanks!

Top answer
1 of 5
65
I would start by doing incremental update from 14 to 16 then fix any breaking changes including the projects dependencies. Then goes from 16 to 18 and repeat the cycle. Eventually you will end up with version 20. It will take quite some time but I think if something broke it's easier to track and isolate and then fix what's broken
2 of 5
14
I've just finished doing Node 12-16. I feel your pain. With the number of dependencies you've got I would recommend going via Node 16 and 18 and test everything at each stage. If it's not too painful for your devops processes, release incremental versions so you can get real feedback, and you can demonstrate your progress to management. NVM will be your friend, as will the engines field in package.json. That'll make sure you're always running the right version. My first step was a REALLY boring but necessary one. Go through the changelog for EVERY dependency and make a note of which Node versions each major version supports. This means that you won't upgrade anything you don't need to, but also you won't waste time upgrading something too far. Always upgrade to the lowest version you can get away with otherwise you'll be creating needless work for yourself. My other bit of advice would be to not refactor ANYTHING unless you absolutely have to. I found myself getting stuck in the weeds too many times because I was getting sidetracked fixing issues I found along the way. You'll have to do some as there will be breaking changes but resist temptation or you'll end up way behind schedule. With any luck going from 14-16 will be the most painful as pretty much everybody has dropped support for 14. There's still some support out there for 16 and 18 is still current, so 18-20 should be easy. Be under no illusions about how much work this will be, but if you're careful it shouldn't be difficult work. Read the documentation carefully, and good luck!
🌐
Bacancy Technology
bacancytechnology.com › bacancy technology › blog › node.js
Upgrading Node js to Latest Version: How to Update Faster?
May 9, 2025 - This blog represents a step-by-step tutorial guide on upgrading Node js to latest version using macOS, Linux, and Windows for business owners, developers, and CTOs. Discover the core reasons for updating Node js to the latest version and valuable tips for a seamless process.
🌐
Node.js
nodejs.org › en › blog › release › v14.0.0
Node.js — Node.js v14.0.0 (Current)
[a621608f12] - (SEMVER-MAJOR) build: update macos deployment target to 10.13 for 14.x (AshCripps) #32454
Find elsewhere
🌐
Auth0
auth0.com › blog › nodejs-v-14-whats-new
Node.js v14: What's New?
In this version update, we see a couple of experimental additions. Those include: ... Head on over to the official Node.js v14 docs to find out all the updates and experiments!
Top answer
1 of 16
1868

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

Upgrade older versions of node 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 from the .msi in Windows from the node website.

2 of 16
839

All Platforms (Mac, Linux & 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 over-write 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 brew 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
... its 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 & re-open 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 principal 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!
🌐
freeCodeCamp
freecodecamp.org › news › how-to-update-node-and-npm-to-the-latest-version
How to Update Node and NPM to the Latest Version
April 12, 2022 - This command will install the latest version of NPM globally. On Mac, you may have to pass the sudo command before NPM, as this installs NPM at the root of your device, and you need privileges to do that. In this article, we've seen how to update Node and NPM to their latest versions.
Top answer
1 of 6
61

To update nodejs to 14.x run the following commands:

sudo apt update
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
sudo apt install -y nodejs
node -v

After running the final command you should see:

v14.15.0
2 of 6
18

Update for 2024

Since this question was posted, version 20 became the newest LTS version. So Ahmed Boutaraa's answer was correct for the version 14 part of the question, but people stumbling on this question may be seeking the most recent LTS. If you follow those instructions, you will be stuck in version 14.

Luckily, NodeSource also provides an installation script that installs the current LTS rather than a specific version. That should make this answer a bit more future-proof. You can also get the same info straight from the source.

As an aside, there is a script called nvm that is great for managing your node version. It makes it easy to install multiple versions, like if you work with multiple projects with different version requirements or if you want to experiment with the latest version and easily switch back to LTS for regular work. You can find installation instructions on their repository.

How to install the latest LTS version

This set of instructions will install whatever version is the latest LTS version. When a new version is released, you may have to run these instructions again to pull the new install script for the new version.

# As a user with sudo
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

# OR as root
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
apt-get install -y nodejs

How to install the latest non-LTS version

This set of instructions will install whatever version is the latest non-LTS version. When a new version is released, you may have to run these instructions again to pull the new install script for the new version.

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

# OR as root
curl -fsSL https://deb.nodesource.com/setup_current.x | bash -
apt-get install -y nodejs

How to lock into v21 (latest, for now)

# As a user with sudo
curl -fsSL https://deb.nodesource.com/setup_21.x | sudo -E bash -
sudo apt-get install -y nodejs

# OR as root
curl -fsSL https://deb.nodesource.com/setup_21.x | bash -
apt-get install -y nodejs

How to lock into v20 (current LST)

# As a user with sudo
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

# OR as root
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
🌐
eSparkBiz
esparkinfo.com › how to update node js
How To Update Node JS To Latest Version? (Complete Guide) - eSparkBiz
March 12, 2025 - With every new version, Node.JS ... the projects. Today, we will about How To Update Node JS to the latest version. Recently, a new version of Node.JS Architecture has been introduced for the users and the numeration is Node.JS 14....
Price   $12
Address   1001 - 1009 10th floor City Center 2, Sukan Mall Cross Road, Science City Rd, 380060, Ahmedabad
🌐
Mend
mend.io › free-developer-tools › blog › how-to-update-node-js-to-latest-version
How To Update Node.js To Latest Version
October 31, 2024 - Learn how to easily update Node.js to the latest version on macOS, Linux, & Windows.
🌐
NodeSource
nodesource.com › blog › Update-nodejs-versions-on-windows
How to Update Node.js Versions on Windows
February 4, 2025 - If you're using Windows, there are multiple ways to update Node.js, whether you prefer a simple installer, a package manager, or a version manager.
🌐
Gatsby
gatsbyjs.com › documentation › upgrading node.js
Upgrading Your Node.js Version | Gatsby
There are two popular packages used for managing multiple versions of Node.js on your system. Use one of these to update to a newer version of Node.js if they’re already available on your computer.
🌐
HostingAdvice
hostingadvice.com › home › how-to
How to Update Node.js to the Latest Version (2024)
January 28, 2024 - Run an update of nvm first, then get the latest packages of Node.js to update your web server environment: ... You’ll have to close and re-open the terminal first, but you can verify a successful installation by using command -v nvm. The command will output the current nvm version if everything worked.