RackUp IT - View Cloud Hosting Plans

Get started now or speak directly with our engineering team for specialized assistance.

Logo
DevelopmentWEB & APPCalculatorTOOLServicesProductBlogOur TeamCareers
View Plans
Home>Blog>How to Update Node.js to the Latest Version (nvm, Windows, macOS, Linux)
VPS Hosting

How to Update Node.js to the Latest Version (nvm, Windows, macOS, Linux)

Alex Vance
Alex Vance
Published Oct 21, 2026· Updated Nov 9, 2026•✓ Verified Expert Reviewed•3 min read
How to update Node.js guide cover

Key Takeaways

  • ✓Check your version with node -v and npm -v.
  • ✓nvm is the easiest way to install, switch and update Node versions.
  • ✓Use an LTS release for production; Current is for testing new features.
  • ✓Reinstall global packages after switching versions.

Table of Contents

  • •How to Update Node.js to the Latest Version (nvm, Windows, macOS, Linux)
  • •Check Your Current Version
  • •LTS or Current?
  • •Method 1: nvm (macOS and Linux, Recommended)
  • •How to Update nvm Itself
  • •Method 2: Windows
  • •Method 3: macOS with Homebrew
  • •Method 4: Linux Package Manager
  • •Update npm Too
  • •After Updating
  • •Frequently Asked Questions
  • •Host Your Node.js App

How to Update Node.js to the Latest Version (nvm, Windows, macOS, Linux)

Updating Node.js keeps you on supported, patched releases and gives you newer language features. The safest method depends on how Node was installed in the first place, so start by checking that.

Check Your Current Version

node -v
npm -v
which node      # macOS/Linux: shows where Node is installed
where node      # Windows

If the path contains .nvm, update with nvm. If it is /usr/bin/node, it came from your Linux package manager. On Windows, a path under Program Files means the official installer.

LTS or Current?

Node.js releases a new major version every six months. Even-numbered versions become LTS (Long-Term Support) and receive fixes for about two and a half years; odd-numbered versions are short-lived. Use the latest LTS for production and check nodejs.org to see which release is LTS right now.

Method 1: nvm (macOS and Linux, Recommended)

nvm (Node Version Manager) installs Node in your home folder and lets you switch versions per project. Install it with the one-line script from the nvm GitHub page, open a new terminal, then:

nvm install --lts          # install the latest LTS
nvm use --lts
nvm alias default lts/*    # use it in every new terminal

nvm ls                     # list installed versions
nvm install 24             # install a specific major version

Bring your global packages along when you upgrade:

nvm install --lts --reinstall-packages-from=current

How to Update nvm Itself

nvm has no self-update command. To update it, re-run the install script: the nvm README says the same script both installs and updates nvm.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash

v0.41.0 is the latest nvm release (checked on GitHub, 9 November 2026); use the newest version tag from the nvm repository when you run it. Then open a new terminal and check with nvm --version. The Node.js versions you installed with nvm are kept.

If you installed nvm with git, the README also documents a manual upgrade:

(
  cd "$NVM_DIR"
  git fetch --tags origin
  git checkout $(git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1))
) && \. "$NVM_DIR/nvm.sh"

nvm-windows is a separate project with its own installer. To update it, download the latest installer from its GitHub releases page (v2.0.1 at the time of writing) and run it.

nvm, Node.js and npm are three separate updates: updating nvm changes the version manager; nvm install --lts updates Node.js; npm install -g npm@latest updates npm.

Method 2: Windows

  • Installer: download the LTS installer from nodejs.org and run it; it replaces the existing version.
  • winget: winget upgrade OpenJS.NodeJS.LTS (or winget install if it is not installed yet).
  • Multiple versions: use nvm-windows, a separate project with similar commands (nvm install lts, nvm use).

Close and reopen your terminal afterwards, then run node -v.

Method 3: macOS with Homebrew

brew update
brew upgrade node

Homebrew's node formula tracks the newest release; install a specific LTS line with formulas such as node@22 if you need one.

Method 4: Linux Package Manager

Distribution repositories (for example Ubuntu's apt install nodejs) often ship an older Node.js. For a current LTS on a server, either use nvm or the official NodeSource repository for the major version you want, following the instructions on its GitHub page, then:

sudo apt update
sudo apt install nodejs

Update npm Too

npm install -g npm@latest

After Updating

  • Delete node_modules and run npm ci (or npm install) so native modules are rebuilt for the new version.
  • Pin the version for your project in package.json ("engines") or an .nvmrc file.
  • On a server, restart your process manager (pm2 restart all or your systemd service) so the app actually runs on the new version.
  • If your app runs in Docker, change the base image tag (for example node:24-alpine) and rebuild instead; see why use Docker.

If the app sits behind Nginx and stops responding after the update, see fixing 502 Bad Gateway.

Frequently Asked Questions

Is there an nvm self-update command?
No. Re-run the nvm install script for the version you want; it updates nvm in place and keeps your installed Node.js versions.

How do I check my Node.js version?
Run node -v in a terminal. Use npm -v for npm.

Does updating Node.js break my projects?
Usually not between LTS versions, but native modules must be rebuilt. Delete node_modules and reinstall, then run your tests.

Can I have multiple Node.js versions installed?
Yes, with nvm (macOS/Linux) or nvm-windows. Each project can use its own version.

Host Your Node.js App

RackUp IT hosting runs Node.js apps on managed servers with SSL, backups and monitoring included, so a runtime upgrade is a setting, not a weekend.

← Previous ArticleWhy Use Docker? 10 Real-World Use Cases (and When Not To)Next Article →How to Deploy Django to a VPS With Gunicorn and Nginx (Ubuntu)
Interactive 60-Second Tool

Unsure Which Cloud Hosting Plan Fits Your Site?

Answer 4 quick diagnostic questions to estimate the server CPU, RAM and storage you need with transparent pricing.

Free Migration 99.9% Uptime Target
Calculate My Hosting Build
Alex Vance
Written ByAlex Vance

Cloud Infrastructure Engineer.

99.9% Uptime Target

RackUp IT - View Cloud Hosting Plans

View Hosting Plans

View Hosting Plans

CONTENTS

  • How to Update Node.js to the Latest Version (nvm, Windows, macOS, Linux)
  • Check Your Current Version
  • LTS or Current?
  • Method 1: nvm (macOS and Linux, Recommended)
  • How to Update nvm Itself
  • Method 2: Windows
  • Method 3: macOS with Homebrew
  • Method 4: Linux Package Manager
  • Update npm Too
  • After Updating
  • Frequently Asked Questions
  • Host Your Node.js App

Categories

  • VPS Hosting
  • DevOps & Tutorials
  • WordPress Hosting
  • Cloud Hosting
  • Server Stack
  • Networking & Security
  • Web Hosting / Managed Cloud
  • E-Commerce
  • Hosting & SEO
  • Hosting Benchmarks
  • Cloud Backup & DevOps
  • Managed VPS

Recent Posts

  • Vultr Alternatives in 2026: VPS Hosting for Developers Compared
  • Docker Port Mapping Explained: -p, EXPOSE and Compose ports
  • Bluehost Alternatives (2026): WordPress Hosting Without the Renewal Price Jump

Tags

Node.jsJavaScriptnvmLinuxDevOps

Related Posts

Vultr alternatives coverVPS Hosting
Nov 27, 2026

Vultr Alternatives in 2026: VPS Hosting for Developers Compared

Vultr's Regular Performance prices compared with DigitalOcean, Linode, Hetzner and a fixed-plan VPS at the 8 GB size, plus when container hosting fits better.

Read Article →
What is a VPS? Virtual private servers explainedVPS Hosting
Nov 20, 2026

What Is a VPS? Virtual Private Servers Explained

A VPS (virtual private server) is a virtual machine with its own operating system, resources and root access. How it works, uses, and when you need one.

Read Article →
Linode alternatives coverVPS Hosting
Nov 19, 2026

Linode (Akamai) Alternatives in 2026: VPS Hosting Compared

Linode's shared CPU prices from Akamai's own API, compared with DigitalOcean, Vultr and a fixed-plan VPS, plus when container hosting makes more sense.

Read Article →
Logo

Expert Web & App Development, UI/UX Design, Branding, and Consulting to scale your business.

Company

  • About Us
  • Blog
  • Contact
  • Our Team
  • Careers

Services

  • Web Development
  • App Development
  • UI/UX Design
  • Consulting
  • Managed WordPress VPS
  • Website Speed Test

Subscribe to our newsletter

We accept
  • bKash
  • Nagad
  • Rocket
  • Upay
  • CellFin
  • Meghna Pay
  • OK Wallet
  • Tap
  • mCash
  • DBBL Nexus
  • Visa
  • Mastercard
  • American Express
  • Crypto
Pay with Visa, Mastercard, American Express, DBBL Nexus, CellFin, Rocket, bKash, Tap, Meghna Pay, Nagad, mCash, Upay and OK Wallet. Verified by EPS

© 2026 Rackup IT Solution. All rights reserved.

Privacy PolicyTerms of Service