How to update Node.js

There are multiple ways to install Node.js; therefore, depending on how it was installed, there are numerous ways to update its version as well.

First, check which version of node is currently running on your system using the command:

node -v

Ways to update

There are three possible ways to update a Node.js version:

1. Updating using nvm

The node version manager nvm is a popular way of running Node – it allows us to switch between various Node versions and install new versions.

To update using nvm, use the following two commands:

nvm install <VERSION_NUMBER>
nvm use <VERSION_NUMBER>

2. Updating using Homebrew (macOS)

Homebrew is another popular package installer on macOS. To update a ​Node.js version using Homebrew, use the following command:

brew upgrade node

3. Updating using official installer

The official Node.js downloads page includes pre-made installers for Windows and macOS; download and run these installers to update your version of Node.js. Newer versions of Node.js will automatically replace ​older versions.


Free Resources

Copyright ©2025 Educative, Inc. All rights reserved