

That’s all! Node Version Manager is a simple bash script to manage multiple active node.js versions on your Linux system. Then use some of the commands we have just looked at above to operate with the specified version in the file.įor more information, see nvm -help or go to the Node Version Manager Github repository. nvmrc initialization file in your project root directory (or any parent directory) and add a node version number or any other flags or usage options that nvm understands, in it.

# nvm which system #check system-installed version of a node using “system” aliasįurthermore, to manually set a default node version to be used in any new shell, use the alias “default” as shown. Importantly, you can view the path to the executable to where a specific node version was installed as follows: # nvm which 10.15.3 You can use a node.js version in any new shell as shown: # nvm use node #use defaultĪlternatively, simply run a node version as shown (to exit, press ^C). You can check all installed version with the following command: # nvm ls To install a specific “node” version, first list the available node versions and then install the version as shown. Note that in the above command, “node” is an alias for the latest version. To download, compile, and install the latest release of node, run the following command: # nvm install node
#Linux install nvm how to#
Now it is time to learn how to use Node Version Manager in Linux. Even if you only need a single version of Node.js right now, we still recommend using nvm because it allows you to switch between different versions of Node (depending on the requirements of your project) with minimal hassle. It will show output as ‘ nvm‘ if the installation was successful. Using nvm (Node.js Version Manager) makes it easier to install and manage multiple versions of Node.js on a single local environment. Next, verify if the nvm has been installed on your system using the following command. The above auto-install script clones the nvm repository to ~/.nvm in your home directory and adds the required source commands to your shell startup scripts i.e ~/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc, depending on the shell program you are using as shown in the following screenshot.
