How to update Node in Linux using NVM

The following commands will update Node installed on Linux using NVM. NVM is a Node version manager. Instead of uninstall/install-ing a new version of Node every time we need it, we can use this tool to select the active version of node.

Execute in your Linux terminal:
// update the package repository
sudo apt update

// download the nvm install command and run it in bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/<version>/install.sh | bash

// reset the terminal
source ~/.bashrc

// check if the correct version is installed
nvm --version

// check the local Node versions available
nvm ls

// check all the versions available remotely
nvm ls-remote

// install the version you need
nvm install <version>

// install the latest lts version
nvm install --lts

// use the latest lts version
nvm use --lts

// or use a specific version
nvm use <version>

0 Comments

Post a Comment

Post a Comment (0)

Previous Post Next Post
NERV Open Source
Building production Spring Boot systems?

Explore NERV — open-source Java libraries for audit trails, persistence, exception handling, and reliable event-driven architecture.