Easy Tutorial
❮ Counting Sort Verilog2 Slow2Fast ❯

Step-by-Step Guide on How to Install Multiple Versions of Node

Category Programming Techniques

Recently, many people have been asking how to install multiple versions of Node at the same time, how to configure Node's environment variables, and how to switch between different versions of Node with ease. Due to these reasons, I plan to write an article specifically explaining how to install multiple versions of Node!

Node versions can be found at

>

When installing multiple versions of Node, it is essential to start with the lower version. If you install the higher version first, you will encounter many problems. If you have already installed it, uninstall it first and then follow the steps below.

After downloading, you will get the installation package, which includes 32-bit and 64-bit versions for multiple Node installations. Users should choose according to their system.

Before installing Node, I first choose a Node installation directory. I want to install it on the D drive, so I created a new Node directory in the D drive and created a folder named 4.42 inside it, because I will install the 4.42 version of Node in this folder later.

Begin the installation:

Open the Node 4.42 installation package and click Next until you reach the installation path screen:

Change the installation path to the path of the 4.42 folder we created, and then continue with Next. After the installation is successful, you will see many files in the folder, and at this point, Node is installed.

Change the path inside to D:\node\4.42\

Is Node ready to use after installation? Of course not, you still need to configure the environment variables: Computer => Properties => Advanced System Settings => Environment Variables

In the System Variables, click New, variable name: node_4.42, the variable value is the installation directory of your 4.42 version, which is D:\node\4.42\

Click OK, then in the System Variables, find the path variable, select it and click Edit.

See the value in the path variable? We add the newly created variable to this, how to add it? A pair of % signs, write the newly created variable name in the middle, and put it at the end of the path, and don't forget the ; in the middle, each variable should have a ; in between.

After setting it, click OK, and then let's open CMD (win+R); enter:

$ node -v

If the version number appears, then our first Node has been successfully installed and is ready to use.

Installing multiple versions: After the first one is installed, install the second Node version.

Before installing the new version, we need to do is find the installation directory of the previous version, which is D:\node\4.42, and then rename the 4.42 folder (because if you don't change the name, no matter where you install the new version, it will overwrite the previous one):

After renaming, create a new directory, I named it 5.11 (because I plan to install the 5.11 version next).

Then start installing 5.11, the process is the same as above, until the environment variables are configured, and our 5.11 is installed.

After installing the 5.11 version, let's change the 4.42 directory back;

Verify whether we have installed two Node versions: where node, and the current version in use: node -v

$ where node

>

If two appear in where node, it means we have indeed installed two versions of Node, and node -v tells us which version is currently in use!

If we want to install other versions, the method is the same, just follow the above.

Suppose we have installed many Node versions, but the current Node version is not what I want to use now? How to switch Node versions?

Open the environment variables, find path. Whichever version you want to use, put that Node variable at the very front of all Node variables. For example, if my previous path was %node_4.42%;%node_5.11%, I am using the 4.42 version. If I want to

use the 5.11 version, I have to change the %node_4.42%;%node_5.11% in the path to %node_5.11%;%node_4.42%

2 At this point, let's check again: where node and node -v

This is how we install multiple versions of Node and switch between Node versions.

>

Original Author: Xiao Niao Yi J

❮ Counting Sort Verilog2 Slow2Fast ❯