16

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!

slim1801
  • 531
  • 3
  • 8
  • 19
  • 3
    I'm voting to close this question as off-topic because it should be moved to the http://raspberrypi.stackexchange.com/ – Irwin Sep 15 '15 at 02:23
  • 1
    Oh, I did not realise there was a subdomain for raspberry pi questions. Do I need to move it or will it be done by admins? – slim1801 Sep 15 '15 at 08:09
  • possible duplicate of [version \`CXXABI\_1.3.8' not found (required by ...)](http://stackoverflow.com/questions/23494103/version-cxxabi-1-3-8-not-found-required-by) – tripleee Sep 17 '15 at 11:14

6 Answers6

44

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/

Joel Ellis
  • 1,332
  • 1
  • 12
  • 31
Irwin
  • 12,551
  • 11
  • 67
  • 97
9

Alternatively you can upgrade your GCC to V4.8 for this package to work!

Option 1 (the better option):

sudo apt-get update
sudo apt-get install gcc-4.8 g++-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50

Options 2: Upgrade to Debian Jessie

Replace all instances of "wheezy" in /etc/apt/sources.list

sudo apt-get update
sudo apt-get dist-upgrade

After this you download the Node.js using command line as follows:

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

Next step is to install the Node.js:

sudo dpkg -i node_latest_armhf.deb

Finally, you can verify the installation:

node -v

These instructions are mentioned on http://node-arm.herokuapp.com/

James Taylor
  • 6,158
  • 8
  • 48
  • 74
  • 1
    Thanks Prashant, I tried option1, however I still received the same error – slim1801 Sep 15 '15 at 08:25
  • @slim1801 "GLIBCXX_3.4.20' not found" issue is basically due to latest upgrade. You can try archive verison of node.js by following command:- wget http://node-arm.herokuapp.com/node_archive_armhf.deb sudo dpkg -i node_archive_armhf.deb – Prashant Pathak Sep 23 '15 at 07:46
6

That runs for me: http://blog.wia.io/installing-node-js-v4-0-0-on-a-raspberry-pi/

Raspberry Pi Model A, B, B+ and Compute Module

wget https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-armv6l.tar.gz
tar -xvf node-v4.0.0-linux-armv6l.tar.gz
cd node-v4.0.0-linux-armv6l

Raspberry Pi 2 Model B

wget https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-armv7l.tar.gz
tar -xvf node-v4.0.0-linux-armv7l.tar.gz
cd node-v4.0.0-linux-armv7l
sudo cp -R * /usr/local/
Tomasz Jakub Rup
  • 10,502
  • 7
  • 48
  • 49
Baworaczech
  • 61
  • 1
  • 1
2

use nodejs instead of node

sudo apt-get update && sudo apt-get install nodejs

for npm

sudo apt-get install npm

Awais Rafique
  • 466
  • 6
  • 17
0

The Latest Node is released for the below platforms, which helped for my old R-PI which is of model name : ARMv6-compatible processor rev 7 (v6l)

https://nodejs.org/download/release/v4.1.0/

node-v4.1.0-linux-arm64.tar.gz 17-Sep-2015 04:24 10886090

node-v4.1.0-linux-arm64.tar.xz 17-Sep-2015 04:24 7100824

node-v4.1.0-linux-armv6l.tar.gz 17-Sep-2015 17:37 10763504

node-v4.1.0-linux-armv6l.tar.xz 18-Sep-2015 00:15 7005048

node-v4.1.0-linux-armv7.tar.gz 17-Sep-2015 05:17 10773951

node-v4.1.0-linux-armv7.tar.xz 17-Sep-2015 05:18 7004760

node-v4.1.0-linux-armv7l.tar.gz 18-Sep-2015 12:58 10773951

Vikas Putcha
  • 168
  • 1
  • 1
  • 9
-1

You can try the following command: wget node-arm.herokuapp.com/node_archive_armhf.deb

then sudo dpkg -i node_archive_armhf.deb

node -v should work now!

Amibest
  • 687
  • 7
  • 6