Skip to content

Install Node.js

Volodymyr Huz edited this page Jan 26, 2020 · 3 revisions

Install and configure Node.js for using HomeBridge.

Patch and update your Pi

sudo apt-get update
sudo apt-get dist-upgrade

First way to install

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

Second way to install

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 --ltsnvm 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

Remove Node.js

sudo apt-get remove nodejs

Clone this wiki locally