DEV Community

Cover image for Installing Node.js using nvm, the best way.
Philip Onuchukwu
Philip Onuchukwu

Posted on

Installing Node.js using nvm, the best way.

This article is intended to take you through the best way to get node.js LTS running on your windows machine at ease.

Node.js

This is an open-source, cross-platform JavaScript runtime environment; that runs on Windows, Linux, Unix, Mac, etc. It's not exclusively designed for the Backend as it also feeds the Frontend with API services and then serves it in real-time.

Steps to get node.js installed

  • Follow the link to download nvm nvm repository
  • Download the nvm-setup.zip
  • Open the zip file, to extract the nvm-setup.exe file.
  • install the setup as administrator. the Windows installation wizard will prompt you.

Image description

  • Once the installation is complete. Open your CMD, Gitbash, or PowerShell to list versions currently running or installed. with Windows-nvm (nvm ls) if non, continue the process.
    check for current version in use

  • Check for available versions of node.js to use with (nvm list available)
    list of node.js using nvm

  • From the list above chose the recommended version for you. The latest stable release LTS of node.js is highly Recommended. Let us install the LTS version number with(nvm install 16.15.1).
    latest version of nvm

  • You can now list the versions of node.js that are installed with (nvm ls)
    list node.js installed nvm ls

  • Use the Windows-nvm command. (nvm use 16.15.1) to set or activate the current version to be used, you can as well switch version

  • Finally, verify that node.js is installed and the version with (npm --version).

With this you can confidently run all your ng, npx, npm command for Angular, React, etc... smoothly.

Error Handling

Incase you've installed node.js without nvm and you're experiencing errors, try installing it now with nvm. if the error persists, kindly navigate to your local(c:) -> program file -> locate node.js folder and delete it or rename it and continue the installation.

Hope this helps... Cheer

Top comments (5)

Collapse
 
2kabhishek profile image
Abhishek Keshri

I would suggest using asdf-vm, sooner or later you will have more tools to manage versions of

Collapse
 
_sirphil profile image
Philip Onuchukwu

Wow... that sounds great.

Collapse
 
2kabhishek profile image
Abhishek Keshri

It is, you should deifinitely try it out :)

Collapse
 
andrewbaisden profile image
Andrew Baisden

nvm is such a useful tool switching Node versions on the fly is a piece of cake.

Collapse
 
_sirphil profile image
Philip Onuchukwu

Thanks