How To Install Node.js and npm Ubuntu 18.04, Debian and Linux Mint - Cloud Network

Networking | Support | Tricks | Troubleshoot | Tips

Buymecoffe

Buy Me A Coffee

Sunday, March 29, 2020

How To Install Node.js and npm Ubuntu 18.04, Debian and Linux Mint

How To Install Node.js and npm Ubuntu 18.04, Debian and Linux Mint

Officially Website
https://nodejs.org/en/download/

Stable release: 12.15.0

Offically Github
https://github.com/nvm-sh/nvm

METHOD 1
Step1 :- sudo apt-get update

Step2 :- sudo apt install nodejs

Step3 :- node -v OR node --version OR nodejs -v

Step4 :- npm -v OR npm --version

METHOD 2
Installing Using PPA
sudo apt-get update

sudo apt-get upgrade

sudo apt-get install python-software-properties

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
OR
curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh

sudo apt install nodejs

node --version
nvm --version

sudo apt install build-essential

METHOD 3
Installing Using NVM
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.3/install.sh | bash
nvm ls  OR nvm ls-remote
nvm install (Latest LTS)  OR nvm install --lts
nvm use (Latest LTS)
node --version
nvm ls
nvm alias default (Latest LTS)
nvm use default
nvm install node
npm install express
npm install -g express
npm link express
nvm help
nvm --version

Removing Node.js
sudo apt remove nodejs
sudo apt purge nodejs
sudo apt autoremove
sudo apt remove nodejs npm

nvm current
nvm uninstall node_version
nvm deactivate