HomeOur TeamContact
JavaScript
Managing and switching between different versions of Node by using nvm
Megat Heikal
Megat Heikal
August 05, 2021
1 min
Make sure to subscribe to our newsletter and be the first to know the news.

nvm: Managing and switching between different versions of Node
nvm: Managing and switching between different versions of Node

What is nvm?

nvm can be defined as a Node Version Manager. It is a command line tool that helps web developers to manage and shift between their versions of node. Currently, nvm only works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: unix, macOS, and windows WSL.

Why use nvm?

Node evolves quite quickly. As a result, your old project that used the old node may not work as expected. It is super annoying to just switch different node versions for different projects in your local environment. Here nvm came and played a role to overcome this problem.

Installation

To ensure you have installed the right version, kindly read this documentation:

  1. Curl or wget to install nvm:

    • curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
    • wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
  2. Verify the installation:

    • command -v nvm # It should display "nvm" if the installation was successful.

Usage

  • To download, compile, and install the latest release of node, do this:
    • nvm install node
  • To install a specific version of node, do this:
    • nvm install 10.2.1
  • To use the latest version of node, do this:
    • nvm use node
  • To use the specific version of node, do this:
    • nvm use 10.2.1
  • To see what versions of node are installed:
    • nvm ls
  • To uninstall specific version that not longer needed:
    • npm uninstall 11.1.1

Conclusion

In conclusion, nvm is a good tool. It really helps web developers to deal with a lot of projects with different versions of node. Thank you for reading this article. I hope it helped you in some way.


Tags

#javascript#explanation#tutorial

Megat Heikal

Blockchain & Full-stack Intern

Megat Heikal is a final year computer science student from International Islamic University Malaysia. He is interested in blockchain and experience developing web application using React.

Expertise

Node JS
React JS
Web 3

Social Media

linkedin

Related Posts

Tutorial
Hapi JS
Hapi tutorial - Creating a server and adding routes to display “Hello World!” (Part 1)
August 01, 2021
1 min
Explanation
Blockchain Explanation
What is Decentralized Autonomous Organization (DAO)
January 15, 2020
2 min
© 2021, All Rights Reserved.

Quick Links

Our TeamContact Us

Social Media