Node.js & NPM Update Guide

Last Updated : 26 Feb, 2026

Updating Node.js and NPM is important to maintain a secure, efficient, and modern development environment because it:

  • Provides access to new features
  • Improves performance
  • Fixes security vulnerabilities
  • Ensures compatibility with the latest tools and libraries

Different Methods to Update Node.js and NPM

To update Node and NPM to the latest versions we can use various methods like nvm (node version manager), node.js Windows installer, npm, and homebrew for macOS.

Check the Installed node version

Before updating, check your current Node.js version:

node -v
check-current-node-version
current installed version

Method 1: Using NVM (Node Version Manager)

Step 1: Install NVM on your system, and verify installation

nvm -v

Step 2: Install the latest Node.js version

nvm install node
update-node-using-nvm

This command automatically installs a compatible NPM version along with Node.js.(e.g. npm v10 with node v22)

Step 3: Use the installed version

nvm use 22 

Using NVM you can easily use any version of node if required

  • Check installed Node.js versions:
nvm list 
  • Use a specific version:
nvm use <version>
use-specific-node-version

Method 2: Using the Node.js Installer (Windows and macOS)

Follow these steps to install Node.js on Windows using the Nodejs Installer.

Step 1: Download Installer

Visiting Node.js official website and download the installer.

Step 2: Run Installer by Opening the downloaded installer. Follow the on-screen instructions to complete the installation.

Step 3: Verify Installation

node -v
1
node version in windows

Update npm using NPM

Step 4: Use below npm command to upgrade npm to latest

npm install -g npm@latest

Step 5: Verify latest Installation update

npm -v

Method 3: Using Homebrew on macOS

Homebrew is a popular package manager for macOS that simplifies the process of managing software installations, including Node.js.

Step 1: Install Homebrew by Visiting brew.sh and follow the installation instructions.

Step 2: brew update

brew update

Step 3: Install Node.js

brew install node

Step 4: Update Node.js

brew upgrade node

Step 5: Verify latest Installation update

node -v

Also Check:

Comment

Explore