Fork me on GitHub

Tom Gallacher

How to install Node.js on your Raspberry Pi;

Edit: for use with nodejs > 0.8 use this -> https://github.com/gflarity/node_pi

Disclaimer: I am not a unix god, and pretty much hacked this together to get working (and it does for me), so a more concise method might appear, so I you do find one let me know, also if you break your PI it is not my fault =] .

So you have just received your raspberry pi and are thinking about running nodejs on it, good. Lets get started.

I am assuming that you have pre-installed the debian flavoured distribution, have enough space and are up and running. If your having problems pop over to the Raspberry Pi Forums and they will be able to help you out!

First we need to install the OpenSSL dev libraries for SSL support, you can skip this step by using the --without-ssl flag when configuring.

$ sudo apt-get install libssl-dev

First we need to download the latest stable release v0.6.15 (Having problems compiling the unstable branch at the moment 0.7.X).

$ wget http://nodejs.org/dist/v0.6.15/node-v0.6.15.tar.gz
$ tar -xf node-v0.6.15.tar.gz
$ cd node-v0.6.15
$ export CCFLAGS='-march=armv6'
$ export CXXFLAGS='-march=armv6'

Now to edit the following file:

$ vim deps/v8/SConstruct

Or you can use nano if you prefer, first you need to adjust line 82 and 83 to match the following

 'all': {
   'CCFLAGS':      ['$DIALECTFLAGS', '$WARNINGFLAGS', '-march=armv6'],
   'CXXFLAGS':     ['-fno-rtti', '-fno-exceptions', '-march=armv6'],
 },

Then you need to comment out lines 157-162.

Important: Make sure to remove the comma from the end of 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0']

 'armeabi:softfp' : {
   'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0']
  # 'vfp3:on': {
  #   'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']
  # },
  # 'simulator:none': {
  #   'CCFLAGS':     ['-mfloat-abi=softfp'],
  # }
 },


$ ./configure

The next step will take a while to finish ~40mins

$ make
$ make install

You will now have a working nodejs installation and also have access to npm nodejs’ package manager. If you are using ARM Arch linux then you can download a maintained tarball from http://archlinuxarm.org/arm/community/nodejs-0.6.15-1.1-arm.pkg.tar.xz or as @WarheadsSE pointed out use:

$ pacman -S nodejs

I am in the process of making some benchmarks to see how much this $35 computer can handle, I did get my personal website running last night pi.tomg.co and seemed to handle the traffic quite well. Such an amazing piece of kit!

If you make anything awesome then let me know on twitter @tomgco or email me me[at]tomg.co!

Here are some more semi-colons! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;



  1. p-bobak reblogged this from gxblast
  2. 3dg3w4t3r reblogged this from gxblast
  3. daniellauzon reblogged this from gxblast
  4. bankedtrackrollerderby reblogged this from gxblast
  5. devinsba reblogged this from gxblast
  6. threedoorsdown reblogged this from gxblast
  7. pixel67 reblogged this from gxblast
  8. jalbertbowdenii reblogged this from gxblast and added:
    gHow to install Node.js on your Raspberry Pi:
  9. kysnm reblogged this from gxblast
  10. leftjustified reblogged this from gxblast and added:
    I’ve been planning...RasPi / Node.js / Arduino system since the Pi was announced,
  11. aocos reblogged this from gxblast
  12. gxblast posted this