-
Notifications
You must be signed in to change notification settings - Fork 0
Install Node.js
Patch and update your Pi
sudo apt-get update
sudo apt-get dist-upgrade
Include NodeSource repository into sources list
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
Install Node.js
sudo apt-get install -y nodejs
Check Node.js version
node --version
Download end execute bash script to install nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
Close and reopen your terminal to start using nvm
Check nvm version
nvm --version
Install Node.js latest version
nvm install node
Check Node.js version
node --version
Install additional specific node version (8.9.4)
nvm install 8.9.4
List installed node versions
nvm ls
Change the active node version
nvm use 8.9.4
Check current node version that is using
nvm current
Add Node JS into path variables
export PATH=$PATH:/home/osmc/.nvm/versions/node/v13.9.0/bin
Remove Node.js
sudo apt-get remove nodejs