How To Install Different Versions Of NodeJS

PHP Developer Freelance | E-learning Platform external link
🔗 See other jobs

There are many reasons why you might need a different version of NodeJS.

For instance, running an app that relies on an older version of NodeJS.

NVM is a NodeJS version manager that makes it possible to do just that.

Installing NVM

Follow this section of the ReadMe doc to install NVM.

Installing a specific version of NodeJS

Let's say we would like to install version 12 of NodeJS. We would run the following command to do so:

01: nvm install 12

Once you have different versions of NodeJS installed you can switch between them using the command below:

01: nvm use 12

You can also check which version of NodeJS you are running at any point in time:

01: node -v

Here is another article you might like 😊 "Linux & MacOS: Counting files in a directory"