Monday, March 12, 2018

Node Version Manager (NVM)

Node Version Manager (NVM) is a neat little bash script that allows you to manage multiple versions of Node.js on the same box. A version manager really helps to test our applications under different versions of the related software. nvm is a tool that allows you to download and install Node.js. You don't need nvm unless you you want to keep multiple versions of Node.js installed on your system or if you'd like to upgrade your current version.
Command to check NVM version:
nvm --version.

Bash command to install NVM:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.26.1/install.sh | bash
How to use NVM:
1. Install Node.js
If you have not already installed Node.js on your machine, it is time to install the latest or a specific version of Node.js using NVM. Below command will install version 0.12.7 for 64-bit Windows by running the command:
$ nvm install 0.12.7 64

2. List the available Node.js versions
In order to list all the Node.js versions installed on your machine, simply run the command:
$ nvm list

3. Use a specific Node.js version
Below command used to set version by running the command:
$ nvm use 4.2.1 64
As Node.js is still a go-to solution, many versions of it are released and new versions will be released in the future. That is where testing an application with various Node.js version comes handy.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.