7

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

asked Sep 14, 2012 at 15:26
9
  • 2
    and i tried to add a 'nodejs' tag but i dont have enough awesomeness to do this here Commented Sep 14, 2012 at 15:26
  • You tried cross-compiling? Commented Sep 14, 2012 at 15:29
  • Are you asking the same as raspberrypi.stackexchange.com/q/1078/86 ? Commented Sep 14, 2012 at 15:32
  • @alex: maybe its the same question. it might be OS specific, in which case its a different question Commented Sep 14, 2012 at 17:33
  • Totally, setup a Cross compiler to do it. It will save hours of compile time. Commented Sep 14, 2012 at 18:10

5 Answers 5

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
answered Nov 7, 2015 at 10:23
2
  • Please do not post duplicate answers to multiple questions. The system flags this as an attempt to game the system. Commented Nov 7, 2015 at 10:36
  • is his answer correct though? should I accept it? It looks better than the others here Commented Nov 9, 2015 at 16:18
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

answered Dec 21, 2012 at 10:12
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.

answered Jun 8, 2015 at 19:38
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

answered Sep 17, 2012 at 16:43
1
  • 1
    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. Commented Sep 25, 2012 at 17:11
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

answered Jun 2, 2017 at 18:39

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.