Managing Node.js Versions with NVM(Node Version Manager)

Managing Node.js Versions with NVM is pretty easy and simple.Node Version Manager (NVM) is a clean and neat little bash script which allows you to manage multiple versions of Node.js on the same box.  If you are working with different node.js applications you might switch to the different version of node quiclkly to test the application.A version manager really helps to test our applications under different versions of the related software.That’s where you can use nvm to download, install, and use different versions of Node.js:

Installation of Node Version Manager:

The steps are pretty simple and easy to install NVM. You do have to have at least one version of node and npm to get started, but after that, you can install nvm with .npm

$ npm install -g nvm

Once you do the installation using above command the next step is to Setup the NVM. Follow the below steps to setup Node version manager.

Setup NVM Path

export PATH=./node_modules/.bin:$PATH

Note, this is a good thing to do anyway – it will allow you to run things like jshint on a per-repo basis without having to install it globally and without having to prefix the path.

Once you have configured NVM on your machine it’s now easy to install any version of node.js into your machine and switch to different version whenever needed.

To install Node.JS version using NVM

nvm install 4.0

Switch to another version of Node.JS using NVM

nvm use 0.12

To check all the versions of node installed in your machine simply run the below ls command in nvm window.

List all version of Node.JS Installed

nvm ls

To Uninstall, a specific version of node run the below command

nvm uninstall 0.10
Leave a Reply

Your email address will not be published.

Sign Up for Our Newsletters

Subscribe to get notified of the latest articles. We will never spam you. Be a part of our ever-growing community.

You May Also Like
Javascript

Javascript URLEncode

Let us take a look at what would be the best approach for Encoding URL using Javascript. There are basically 3 Javascript URLEncode methods available. Types of Javascript URLEncode escape()…
View Post