Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io.js for Raspberry Pi 2? #1105

Closed
Tineler opened this issue Mar 9, 2015 · 11 comments
Closed

io.js for Raspberry Pi 2? #1105

Tineler opened this issue Mar 9, 2015 · 11 comments
Labels
arm Issues and PRs related to the ARM platform. question Issues that look for answers.

Comments

@Tineler
Copy link

Tineler commented Mar 9, 2015

I don't really know where to put this question. If this is the wrong place, please feel free to delete it. :-)

Do you know, if the current io.js version is compatible to Raspberry Pi 2 running Raspbian?

@Fishrock123
Copy link
Contributor

We have armv7 builds here, I think those should work? https://iojs.org/dist/v1.5.0/

otherwise you may have to build it yourself, but I think it should work. cc @rvagg

@Fishrock123 Fishrock123 added the question Issues that look for answers. label Mar 9, 2015
@silverwind
Copy link
Contributor

Yeah, those builds will most likely work as-is. I don't own a RPi2, but on a regular RPi, it's just download and copy to a bin dir.

@rlidwka
Copy link
Contributor

rlidwka commented Mar 9, 2015

Yeah, the only difference is: on RPi you download armv6l build, and on RPi2 you download armv7l one. In general, you can use uname -m to check your CPU arch.

@rvagg
Copy link
Member

rvagg commented Mar 9, 2015

Let us know how the armv7 builds go. I believe Raspbian is still Wheezy-based which is a problem because our armv7 builds are currently being done on a more recent Ubunut-based distro with a newer libc, whereas the armv6 builds are being done on Rasbpian/Wheezy proper. We intend to fix this soon.

ref #349

@Tineler
Copy link
Author

Tineler commented Mar 9, 2015

Thanks for your answers. I'll try to install the armv7 build tomorrow and will let you know the outcome.

@fivdi
Copy link

fivdi commented Mar 9, 2015

The armv6 io.js builds work fine on Wheezy based Raspbian on the Pi1 and Pi2, even though the Pi2 has an ARMv7 processor. There is only one distribution of Raspbian for both the Pi1 and Pi2 at the moment and it's also an armv6 build.

@Tineler
Copy link
Author

Tineler commented Mar 11, 2015

First update:

I managed to install io.js on my Raspberry Pi 2 using the armv5 build. Since I can call "iojs -v" this seems to work. But running npm throws the error Cannot find module 'npmlog'.

Here's how I did it so far:

  1. download io.js wget https://iojs.org/dist/latest/iojs-v1.5.1-linux-armv6l.tar.gz
  2. unpack tar -xzf iojs-v1.5.1-linux-armv6l.tar.gz
  3. copy bin-folder to /usr/bin cd iojs-v1.5.1-linux-armv6l cp bin/* /usr/bin

But I'm not sure, where I should move the other folders of ios (include, lib, share). Any idea?

@Tineler
Copy link
Author

Tineler commented Mar 11, 2015

I finally get it to work by moving the files into /usr/local;

  1. download io.js wget https://iojs.org/dist/latest/iojs-v1.5.1-linux-armv6l.tar.gz
  2. unpack tar -xzf iojs-v1.5.1-linux-armv6l.tar.gz
  3. Instead of copying the bin-folder, I copied the whole folder cp -rp iojs-v1.5.1-linux-armv6l /usr/local
  4. Then I created a symbolic link to iojs for being able to update easily: ln -s /usr/local/ iojs-v1.5.1-linux-armv6l /usr/local/iojs
  5. Finally I added /usr/local/iojs/bin to the PATH variable.

After a reboot everything works fine.

So, final answer to my question seems to be: The current version of io.js works with Raspberry Pi by installing the armv6 build. (armv7 build did not work)

@Tineler Tineler closed this as completed Mar 11, 2015
@pgbross
Copy link

pgbross commented Mar 11, 2015

Just a quick note to say I have tried iojs v1.5.1 on the Raspberry Pi 2 (running fedora 21), and it has worked without error. The steps were:

  1. yum install node (this installed the v0.10.36 build of node).

  2. npm install -g n

  3. patch n to add armv7 as a known architecture
    essentially change

    case "$uname" in
    *x86_64*) arch=x64 ;;
    *armv6l*) arch=arm-pi ;;
    esac

    to

      case "$uname" in
      *x86_64*) arch=x64 ;;
      *armv6l*) arch=arm-pi ;;
      *armv7l*) arch=armv7l ;;
      esac
  4. n io latest

I then tested by installing the latest mongodb driver (which also requires a c++ extension so exercises most of the infrastructure and then running a quick script against a mongodb database running on a local machine.

 iojs --eval "var m = require('mongodb'); m.MongoClient.connect('mongodb://192.168.1.81:27017', function(err,res){console.dir(err|| res)})"

So The current version of iojs 1.5.1 works for Raspberry Pi 2 with the armv7 build.

--philip

@junwatu
Copy link

junwatu commented Mar 15, 2015

My solution is to upgrade Raspbian Wheezy to Jessie then compile iojs v1.51 and yes it's finally working on Pi2.

@lukasMega
Copy link

I spend a whole day to get io.js working on Pi2 (but with Minibian, not Raspbian).
After upgrade Wheezy to Jessie I downloaded (latest) iojs-v1.6.2-linux-armv7l.tar.gz and extracted to home/iojs/current and I updated PATH follows:

echo "export PATH=home/iojs/current/bin:$PATH" > /etc/profile.d/iojs_path.sh

Also I executed rpi-update.

# uname -a
Linux raspberrypi 3.18.10-v7+ #774 SMP PREEMPT Wed Mar 25 14:10:30 GMT 2015 armv7l GNU/Linux

# more /proc/version
Linux version 3.18.10-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #774 SMP PREEMPT Wed Mar 25 14:10:30 GMT 2015

# node -v
v1.6.2
# iojs -v
v1.6.2
# npm -v
2.7.1

javascript mocha test example with Nyan Cat reporter

@brendanashworth brendanashworth added the arm Issues and PRs related to the ARM platform. label Jul 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm Issues and PRs related to the ARM platform. question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

10 participants