7

Is there a precompiled binary of the latest Node.js that runs on the Raspbian OS?

gregers
  • 105
  • 4
mkoryak
  • 243
  • 2
  • 8

5 Answers5

2

Node.js distributes official pre-compiled binaries that works on Raspberry Pi:

cd /opt
wget https://nodejs.org/dist/v9.4.0/node-v9.4.0-linux-armv6l.tar.xz
sudo tar xzf node-v9.4.0-linux-armv6l.tar.xz
sudo rm node-v9.4.0-linux-armv6l.tar.xz
sudo ln -s /opt/node-v9.4.0-linux-armv6l /opt/nodejs
sudo ln -s /opt/nodejs/bin/node /usr/bin/node
sudo ln -s /opt/nodejs/bin/npm /usr/bin/npm

To update later, just download and extract the new tar file as above and replace the '/opt/nodejs' symlink with the new release:

sudo unlink /opt/nodejs
sudo ln -s /opt/node-vX.X.X-linux-armv6l /opt/nodejs
gregers
  • 105
  • 4
2

A better approach would be cross-compiling. With that you can compile in your desktop machine and install into the RPi.

Take a look at http://www.raspberrypi.org/phpBB3/viewtopic.php?f=31&t=7493

quimm2003
  • 21
  • 2
1

For more recent versions of node than other answers provide, Adafruit has a repository that, as of node v0.12.0 contains pre-compiled node.js.

Essentially, add the repository in Raspbian

curl -sLS https://apt.adafruit.com/add | sudo bash   

Install:

sudo apt-get install node

Complete tutorial. Note: Haven't tried this yet, but tutorial was published on 2014-12-19 at 04.57.54 PM and updated 2015-05-04 at 04.27.57 PM so seems more recent than other answers.

raphael
  • 298
  • 2
  • 8
0

I was able to compile nodejs without issues using this method:

http://notetodogself.blogspot.com/2012/09/how-to-install-nodejs-on-rasberrypi.html

mkoryak
  • 243
  • 2
  • 8
0

I've written a script that will install the Latest version of NodeJs. Don't wast the time to compile on a raspberry pi. This will work for all raspberry pi's despite processor types (ARM6, ARM7), The scripts handles all of that. All you need to do is run this line of code:

sudo wget -O - https://raw.githubusercontent.com/audstanley/NodeJs-Raspberry-Pi/master/Install-Node.sh | bash
node -v;

source code is here: GitHub: NodeJs-RaspberryPi

Audstanley
  • 99
  • 1
  • 5