Installing Node on the Raspberry Pi

First find the version of node you want to install at https://nodejs.org/en/download/ . At the time of writing this the latest LTS is 10.15.1

Download it

wget https://nodejs.org/dist/v10.15.1/node-v10.15.1-linux-armv6l.tar.gz

Then extract it to /usr/local

sudo tar -C /usr/local --exclude=README.md --exclude=CHANGELOG.md --exclude=LICENSE --strip-components=1 -xzvf node-v10.15.1-linux-armv6l.tar.gz

Test it out

node --version