Search code examples
node.jsdebianraspbianraspberry-pi2dpkg

Installing node.js on raspberry pi 2


I have installed Raspbian on my Raspberry Pi 2 and now I am trying to install node.js on it, however I am hitting an issue.

I followed the instructions and typed these commands into the terminal

wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb

But when I check the version of node using

node -v

I get this error:

node: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by node)
node: /lib/arm-linus-gnueabihf/libc.so.6: version `GLIBC_2.16' not found (required by node)

I am quite new to using raspberry pi, so any help to fix this issue would be great!


Solution

  • Just putting the response from @Prashant Pathak above here:

    1. Download latest nodejs build for Raspberry Pi:

      wget https://nodejs.org/download/release/v0.10.0/node-v0.10.0-linux-arm-pi.tar.gz
      
    2. Unpack files in local directory:

      cd /usr/local
      
      sudo tar xzvf ~/node-v0.10.0-linux-arm-pi.tar.gz --strip=1
      

    That's it. You can confirm it's there by checking the node version with:

    node -v 
    

    and:

    npm -v
    

    The actual url to get the files for node will change as the version changes, you can always see the list of files available for download here: http://nodejs.org/download/

    All these instructions came from: http://www.robert-drummond.com/2015/01/08/server-side-javascript-on-a-raspberry-pi-how-to-install-node-js-2/