

Then we looked at how you can use nvm to install any number of Node.js versions and switch between them as needed. Then we used nvm to install the latest LTS release of Node.js and set it as our environment's default Node.js version. In this tutorial we walked through installing the nvm bash script and making sure it works. Tip: Use nvm alias default to switch the version of Node.js used by default when starting a new shell. Switch to the latest installed version: nvm use node To switch to another version for the active shell use nvm use.įor a specific version provide a version number: nvm use 10.16.3

You can then switch between them depending on which project you're working on. The real benefit of nvm comes when you install different versions of Node.js. Use nvm to install other versions of Node.js You can change this behavior using the nvm alias command.Įxample to set the default version of node to use when starting a new shell to 10.0.0: nvm alias default 10.0.0 Practically this means that anytime you start a new shell, and the nvm.sh script is sourced, it will default that shell to using the installed lts release. This indicates that nvm has set lts/* as the default alias. Note this line Creating default alias: default -> lts/* (-> v10.16.3). Verify it worked, and that the version is correct: node -version nvm install -ltsĭownloading and installing node v10.16.3. Now that you've got nvm installed let's use it to install, and use, the current LTS version of Node.js. Use nvm to install the latest LTS release of Node.js This guide also describes you to switch the default version with the nvm utility and instructions to use different versions during the run time.Finally, run the nvm command to get a list of all the available sub-commands and to further verify that installation worked. This tutorial helped you to install and configure multiple Node.js versions using NVM.

For example, to remove Node.js version 9.5.9 execute the following command: nvm uninstall v9.5.0 Conclusion You can remove any unused version from your system. This command will provide a list of installed versions of node.js on your system. For example nvm run v16.14.0 app.js Step 6 – Remove Unused Node.js Version NVM provides you an option to use a node.js version for running any application. If you have multiple node.js applications on your system and want to run each with a specific version of node.js. Step 5 – Run Application with Specific Version Now verify current active version of node.js node -version The below command will set 17.5.0 as the default Node.js version. You can change the default Node.js version. You can see that Node.js version v16.14.0 is set as the default version. You will see a long list of available versions. Now find out the available version of Node.js to install. CentOS, Fedora and Redhat systems: source ~/.bashrcĪt this point, you have installed nvm on your system for the current user.Debian based systems: source ~/.profile.It will set the required environment variables to use nvm on the system. Reload system environment using this command.Next, run the following command to configure nvm on your system for current logged user.
#Nvm install node version 4 update#
#Nvm install node version 4 windows#
Windows users can visit our other tutorial to install Nodejs on Windows system. The default NVM is installed under current users home directory, So nvm installation with one user will not be accessible to another user. This tutorial will help you to Install and Manage Node.js using NVM. You can also install a specific Node.js version or multiple Node.js versions on the same system using nvm and use the required version for the application. NVM provides an option for the easy installation of Node.js. NVM is known as Node Version Manager, similarly to RVM (Ruby Version Manager) for Ruby language.
