Raja Muhammad Asher
Raja Muhammad Asher

Follow

Raja Muhammad Asher

Follow
How to manage multiple Node versions on Ubuntu 22.04?

Photo by Gabriel Heinzer on Unsplash

How to manage multiple Node versions on Ubuntu 22.04?

Raja Muhammad Asher's photo
Raja Muhammad Asher
·Aug 19, 2022·

1 min read

Node Version Manager allows you to quickly install and use different versions of node via the command line.

NVM Install & Update Script

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

Troubleshooting

After running the install script, if you get nvm: command not found or see no feedback from your terminal after you type command -v nvm, simply close your current terminal, open a new terminal, and try verifying again. Alternatively, you can run the following command for the different shells on the command line:

$ source ~/.bashrc

List of installed Node versions

$ nvm ls

Check current Node version

$ nvm current

List available LTS versions of Node.js

$ nvm ls-remote

Install the Node version

$ nvm install <NODE_VERSION>

Select the Node version to use

$ nvm use <NODE_VERSION>

Uninstall the Node version

$ nvm uninstall <NODE_VERSION>

Set Node Version as default

$ nvm alias default <NODE_VERSION>
 
Share this