Note: this article is published on 12/02/2024.
This series of articles is absolutely a AI product or byproduct. This article could be a new style of my articles: using AI result associated with my own understanding, for example, associated with StackBlitz | Instant Dev Environments, to make the article eazy to write and more readable.
Introduction
This article will discuss NVM --- Node Version Manager. Note: this article is not AI by-product.
- Introduction
- A - What is NVM?
- B - Install NVM on Windows
- C - NVM Commands
- Check Version
- Install Node
- List Installed Node versions
- Make a default Node Version
- Swich Node Version
A - What is NVM?
Node Version Manager (NVM) is a tool for managing Node versions on your device.
When we work on, say, angular project, different projects may be required to use different versions of Node. Using only one version of Node (the one installed by npm
) for these different projects may not be enough to get accurate execution results.
Instead of using npm to install and uninstall Node versions for your different projects, we can use a Node manager tool to switch the node version from one to another. There are more than several different kind of tools for this purpose, see this for info:
we choose the very popular one, NVM, to do the job that allows to install different versions of Node, and switch between these versions depending on the project working on via the command line.
B - Install NVM on Windows
Following this
1. Click on "Download Now"
In the nvm-windows repository Readme, click on "Download Now!":
2. Install the .exe file of the latest release
3. Complete the Installation Wizard
Open the file that you have downloaded, and complete the installation wizard. When done, you can confirm that nvm has been installed by running:
nvm -v
C - NVM Commands
1. Check Version
nvm -v
2. Install Node
nvm install latest
This command will install the last version of Node:
nvm install vX.Y.Z
This will install the X.Y.Z
Node version:
3. List Installed Node
nvm list
as shown above.
4. Make the default Node version:
nvm alias default vX.Y.Z
such as
5. Switch the Node version:
nvm use vA.B.C
or
nvm use A.B.C
such as
References: