Che cos'è Node.js
Node.js è un runtime JavaScript open source e multipiattaforma che permette di eseguire JavaScript anche fuori dal browser.
Che cos'è npm
npm è il package manager di Node.js, usato per installare, aggiornare e gestire dipendenze.
Installazione dal repository Ubuntu
Abilita NodeSource e installa:
sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt install nodejs
Verifica:
node --version
npm --version
Installazione tramite PPA NodeSource
curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install nodejs
Installazione con NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
source ~/.bashrc
nvm list-remote
nvm install v17.0.1
nvm use 17.0.1