What is π—»π˜ƒπ—Ί ❓️ β€” ⓝβ“₯β“œ 𝟭𝟬𝟭 in 5 minutes !

Millan K
2 min readFeb 19, 2022

node version manager β€” super easy way to manage multiple nodeJS versions

Image showing that how nvmβ€Šβ€”β€Šnode version manager,  manages multiple versions of node or nodeJS

What is nvm ❓️

πŸ‘‰ nvm allows you to quickly install and use different versions of node via the command line.

How to install nvm ❓️

πŸ‘‰ 1. using CURL

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

πŸ‘‰ 2. using wget

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

The script clones the nvm repository to ~/.nvm

How to verify installation of nvm❓️

πŸ‘‰ 1. nvm way

$ command -v nvm
nvm

which should output nvm if the installation was successful.

If you get nvm: command not found or see nothing as πŸ‘† simply close your current terminal, open a new terminal, and try verifying again.

πŸ‘‰ 2. Traditional way

$ nvm -v
0.39.1

πŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’š NODE πŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’š

How to Install the latest version of node ❓️ [Feb 2022]

πŸ‘‰ nvm install node

$ nvm install node 
Downloading and installing node v17.5.0...

How to list `node` versions (-> shows default version in use ) ❓️

πŸ‘‰ nvm ls

$ nvm ls
-> v16.8.0
v17.5.0

How to update / change / default a specific node version❓️

πŸ‘‰ nvm use v17.5.0

$ nvm use v17.5.0
Now using node v17.5.0 ....

How to confirm if new defaulted version is set correctly❓️

πŸ‘‰ nvm ls

$ nvm ls
v16.8.0
-> v17.5.0

How to run `app.js` using a non default version ( lets say 16.8.0)❓

πŸ‘‰ nvm run 16.8.0 app.js

$ nvm run 16.8.0 app.js

How to remove a specific / broken `node version` using `nvm`❓️

πŸ‘‰ nvm uninstall v16.8.0

$ nvm uninstall v16.8.0 
Uninstalled node v16.8.0

How to confirm if that was removed successfully❓️

πŸ‘‰ nvm ls

$ nvm ls
-> v17.5.0

πŸ™Reference nvm-sh github README

πŸ™Œ Follow me πŸ™Œ

πŸ‘‰ Medium ⚫️ β—Ό β–ͺ️

β–ͺοΈβ—Όβš«οΈ

LinkedIn πŸ”΅ πŸ”· πŸ”ΉMillan KaulπŸ”Ή πŸ”· πŸ”΅ πŸ‘ˆ

Photo by Brendan Church on Unsplash

--

--

Millan K

Quality Enthusiast, human at heart ❀️ . I write about life in tech and tech in life.I follow me ➑️ #QualityWithMillan or https://QualityWithMillan.github.io