Quick node and npm installation using nvm on Debian
Created:08 Jan 2022 20:42:47 , in Host development, Web development
Below is a bunch of CLI commands for installing Node using nvm command. NVM is a node version manager, basically a BASH script, which makes it easy to install and manage Node versions on an operating system like Debian GNU/Linux. Debian has a package called nodejs which contains Node and npm, but those are older versions and you won't get the flexibility of switching Node versions whatever way you want with it, so it is probably better to use nvm.
Run these commands without sudo or switching to root user.
cd
curl -sL https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh -o install_nvm.sh
bash install_nvm.sh
source ~/.profile
nvm ls-remote | grep "Latest LTS"
As ouput you will get something similar to this:
.
.
.
v4.9.1 (Latest LTS: Argon)
v6.17.1 (Latest LTS: Boron)
v8.17.0 (Latest LTS: Carbon)
v10.24.1 (Latest LTS: Dubnium)
v12.22.8 (Latest LTS: Erbium)
v14.18.2 (Latest LTS: Fermium)
v16.13.1 (Latest LTS: Gallium)
Now to run the lates long term suppored version, run:
nvm install 16.13.1
That's it. You should be able access both node and npm command on the command line now. Enjoy!
Tags: nodejs
Author, Copyright and citation
Author
Author of the this article - Sylwester Wojnowski - is a sWWW web developer. He has been writing computer code for the websites and web applications since 1998.
Copyrights and Citation
Add Comment