nvm is an excellent tool that can be used to manage different versions of nodejs in a single OS. I am using nvm in my development Linux server to switch the nodejs to the latest version after I download it using nvm. A few use cases are as below:
check the current installed nodejs versions
nvm ls
check remote Long-Term-Support nodejs versions
nvm ls-remote –lts
install Long-Term-Support nodejs versions Dubnium
nvm install –lts=Dubnium
You can also install a specific version
nvm install 10.16.2
Most of the time, after you installed a nodejs version, the npm package coming along with the nodejs is not the latest one. You can update it:
npm update -g npm
You can manully switch to another nodejs version:
nvm use v10.16.3
If you are working behind a corporate firewall, a proxy should be set for nvm. Since nvm use curl to communicate with the remote server, the proxy should be set for curl file ~/.curlrc.
proxy = http://10.10.10.10:8080