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

Get notified of the best deals on our WordPress themes.

You May Also Like
Python - List Files In A Directory

Python – List Files in a Directory

Table of Contents Hide Method 1: Using os.listdir() methodMethod 2: Using os.walk() methodMethod 3: Using os.scan() methodMethod 4: Using glob module There are several modules available in Python to list…
View Post
Sort Dictionary By Value In Python

Sort Dictionary by value in Python

Table of Contents Hide Python sorted() function to rescueSyntax: sorted(iterable, key, reverse)Sort a Dictionary by ValueExample 1: Basic Sorting in PythonExample 2 : Sorting different Data Types in PythonExample 3: Sort…
View Post