This tutorial will help you to install nvm on Debian 10 Linux system. It will also help you to install different Node version and other useful examples.

Prerequisites

A running Debian 10 Linux system with shell access. Login with a user account to which you need to install Node.js.

Installing NVM on Debian

You can use a shell script to install NVM on Debian 10 Buster Linux system. Firstly, Open a terminal on your machine. For the remote machines connect via the SSH. Make sure your system have curl command line installed, then execute the nvm installer script on terminal. Above script makes all the required environment settings to login script of current logged in user. To apply the settings logout and login again to account or just execute below command to do the same.

Installing Node using NVM

You can install multiple Node.js versions using nvm. And use required version for your application from installed Node.js. Install the latest version of Node.js. Here node is the alias for the latest version. To install a specific version of node: You can choose any other version to install using above command. The very first version installed becomes the default. New shells will start with the default version of node (e.g., nvm alias default).

Working with NVM

You can use the following command to list installed version’s of Node for the current user. With this command you can find available Node.js version for the installation. You can also select a different version for the current session. This will be current active version for current shell only. To find the default Node version set for the current user, type: You can run a Node script with the desired version of node.js using belwo command:

Conclusion

This tutorial helped you to install nvm on Debian 10 Buster Linux system. You also get some useful information about uses of NVM.