I want to install the latest stable version of Node.js on Raspberry Pi 3. How do I do it in such a way that a) I'm always able to update to latest LTS version b) Can easily switch between versions
Just go to nodejs.org and use the latest installer. just downloaded newest version, install, went to command prompt typed node -v , saw change instantly.
Installing the NodeJS runtime on your Raspberry Pi is a straightforward process and only takes a couple of commands. Alongside NodeJS, you will also install NPM to your Raspberry Pi. NPM is the default package manager for NodeJS and is what you will use to install additional modules.
The Node version manager works great, even for ARM based processors (like Raspberry Pi).
You need to remove the existing version of node installed on Raspbian however (if you are using this distro):
Remove old:
sudo -i
apt-get remove nodered -y
apt-get remove nodejs nodejs-legacy -y
exit
Install n (it will also install latest stable Node.js):
curl -L https://git.io/n-install | bash
Verify:
pi@raspberrypi:~ $ node --version
nv7.6.0
pi@raspberrypi:~ $ npm --version
4.1.2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With