Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you install newest version of node.js on Raspberry Pi?

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

like image 799
rynop Avatar asked Mar 11 '17 22:03

rynop


People also ask

How do I upgrade to NodeJS 12?

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.

Can you install Node JS on Raspberry Pi?

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.


1 Answers

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
like image 64
rynop Avatar answered Oct 26 '22 18:10

rynop