How to Properly Upgrade Node Using NVM

Understand how to upgrade Node.js using NVM. Install the latest or LTS version, switch versions, and manage your Node setup safely across macOS, Linux, and WSL.

Summarize with AI

Not enough time? get the key points instantly.

Use nvm install and nvm use to upgrade Node.js versions easily. NVM allows seamless switching between different Node environments.

Problem

Upgrading Node.js manually can cause compatibility issues or system wide conflicts. NVM is the safer way to manage and switch between Node versions.

Solution

Follow these steps to upgrade Node.js using NVM (Node Version Manager):

1. List Installed Node Versions

bash

nvm ls

This shows all the versions installed via NVM.

2. List all versions

bash

nvm ls-remote

This shows all the Node.js versions available for install.

3. Install the latest

bash

nvm install node

This installs the latest Current version of Node.js.

Or to install the latest LTS version:

bash

nvm install –lts

Also Read:

4. Set default Node version

bash

nvm use nvm alias default

Example:

bash

nvm use 22.17.0nvm alias default 22.17.0

5. Verify Node and npm

bash

node -vnpm -v

Conclusion

NVM is the best way to upgrade Node.js. It allows version switching and protects your environment from system wide conflicts.


Resources

Insights from our engineering leaders.

Our team shares practical insights on the technologies and engineering decisions shaping enterprise software today, grounded in real client work.

NodeJS

Which Company Is Best for Hiring Node.js Developers in the UK?

Node.js helps businesses build backend systems, REST APIs, real-time applications, and SaaS platforms using JavaScript. Developing these solutions requires professionals who understand application architecture, technical…

NodeJS

How to tell if Node.js is installed or not?

To verify Node.js installation, run node -v or node --version. This checks if Node.js is installed and working correctly. Problem Before you run any Node.js…