Installing node with nvm
A proper way to install and updating node.
2 min read
There are many ways in installing Node, but one of my favorite way is using a nvm (Node Version Manager).
In order to use nvm, you need to install the nvm: (as of Aug 13th, 2019).
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
Once you have finished installing the nvm, you can start using the nvm to install Node.
Install the latest version of node:
nvm install node
Use the latest version of node:
nvm use node
LTS is a node version which is recommended for most users. In other words, it is a stable version.
Install the latest LTS version of node:
nvm install --lts
Use the latest LT version:
nvm use --lts
If you wish to install a specific version of Node, you can also use:
nvm install <VERSION>
For example, you can use:
nvm install 10.16.2
After installing Node, you can set a default version to use by using:
nvm use 10.16.2
Useful NVM Command
You can also check the current version of Node by using two commands:
You can also list all the installed version of Node:
If you wish to set a default version for the Node:
nvm alias default <VERSION>