Robs Blog

Blog containing all sorts of info and help from my day to day life

Categories

Install Node.js v0.8.2 on Raspbian

Perform the following steps to get Node.js v0.8.2 installed on Raspbian (The latest OS release for the Raspberry Pi)

Prep the system and get all the components needed to compile

sudo apt-get install git-core build-essential

Download the source and patch it

git clone https://github.com/gflarity/node_pi.git
git clone https://github.com/joyent/node.git
cd node
git checkout origin/v0.8.2-release -b v0.8.2-release
git apply --stat ../node_pi/v0.8.2-release-raspberrypi.patch

Set the flags needed for compilation

export GYP_DEFINES="armv7=0"
export CXXFLAGS='-march=armv6 -mfpu=vfp -mfloat-abi=hard -DUSE_EABI_HARDFLOAT'
export CCFLAGS='-march=armv6 -mfpu=vfp -mfloat-abi=hard -DUSE_EABI_HARDFLOAT'

Configure the compilation

./configure --shared-openssl --without-snapshot

Make & install

make
sudo GYP_DEFINES="armv7=0" CXXFLAGS='-march=armv6 -mfpu=vfp -mfloat-abi=hard -DUSE_EABI_HARDFLOAT' CCFLAGS='-march=armv6 -mfpu=vfp -mfloat-abi=hard -DUSE_EABI_HARDFLOAT' make install
l

Credits

https://github.com/gflarity/node_pi

July 23rd, 2012 by robconvery
Posted in Heating Control

10 Responses to “Install Node.js v0.8.2 on Raspbian”

  1. Stephan Says:

    Did u try that with v0.8.3 too ? any ideas if that is gonna work too ?

  2. robconvery Says:

    I’ve not tried 0.8.3 yet.

  3. Stephan Says:

    ok i did and it works even for v0.8.4 thank you very much

  4. Sankate Says:

    Thanks the instructions were very helpful, I was able to set up my RP. Make took about 2 hours. Before looking at your blog I was struggling with bunch of errors. Thanks again.

  5. Dave B Says:

    Thanks for this. Had been trying to get node.js set up on the Pi for 3 days with no success. Much appreciated.

  6. Lee Wenger Says:

    I’m a bit stuck and could use some help making more progress.

    I can get this whole thing to work on one of three rpi os’s (raspbian) but when I run node command line I get an Illegal argument error and it exits. I did replace the line git checkout origin/v0.8.2-release -b v0.8.2-release
    with v0.8.7 instead using the command line as is gives an error:
    fatal: git checkout: updating paths is incompatible with switching branches.
    Did you intend to checkout ‘origin/v0.8.2-release’ which can not be resolved as commit?

    on the other two they both fail as follows one is raspbian and the other is the older squeeze but getting same error.
    File “./configure”, line 212
    ”’
    ^
    SyntaxError: invalid syntax

    any help is greatly appreciated.

  7. John Winters Says:

    I too get the same error with the git checkout command.

    fatal: git checkout: updating paths is incompatible with switching branches.
    Did you intend to checkout ‘origin/v0.8.2-release’ which can not be resolved as commit?

    It seems there is something subtle wrong with that line in the instructions, but my git-fu is not good enough to enable me to diagnose it.

  8. Yfory Says:

    Just to let you know, I have managed to get this working on Raspbian with 0.8.9, only significant change was:
    git checkout origin/v0.8.2-release -b v0.8.2-release

    becomes:
    git checkout origin/v0.8.9-release -b v0.8.9-release

  9. Zachary Kent Says:

    0.8.9 Worked for me on Raspian “wheezy” just as Yfory said.

  10. R Says:

    Make and install was failing for me with the default download if Raspbian, due to missing the openssl header.

    To fix this: `sudo apt-get install libssl-dev` needs to be done first to.

    Anyway, with the above node v0.8.15 is works.

Leave a Reply