Cloud9 IDE and NodeJS v0.6.15 on Beaglebone

Being that I wanted to develop using Cloud9 IDE and NodeJS v0.6.x, I had to do a bit of digging to get it working.

After Matt Pardee told me the master branch of cloud9 had a -e runtime argument that would allow you to specify which binary to launch when running/debugging from within the IDE, I knew I needed to finally update cloud9. Originally, when I installed Gentoo on my Beaglebone, I was lazy and extracted the cloud9 folder from the Angstrom image, copied it over, installed node v0.4.9, and everything was great. Now I needed to bunker down and figure out the manual build/install.

The first thing you will want to do is copy your node v0.4.x binary to somewhere. I chose to copy it to Cloud9′s folder, being that there is already a place for it. I then updated NodeJS, and then I pulled Cloud9 from GitHub. I thought it’d be a snap, but I was a bit wrong. It took me 3 days of tinkering, and a few days of waiting to get a reply from a developer at Cloud9. What follows is how I went about doing it.

You must have npm and NodeJS v0.4.x initially installed for this to work

1) I initially copied my node binary to my home folder

cp /usr/bin/node ~/node-arm7l

2) I cloned Cloud9 from GitHub

git clone https://github.com/ajaxorg/cloud9.git

3) Initialized all the git submodules

cd cloud9 && git submodule update --init --recursive && cd ..

4) Manually install libxml (it will initially fail to install properly, because I’m still too lazy to figure out how to make npm clone my git repo and the required submodules)

cd cloud9/support/jsdav && npm install

You will get an error. This is caused by the o3 support module failing to compile due to the ARM7 not supporting msse2 (or rather gcc for ARM7 not supporting it).

I forked the o3 and node-libxml repos and fixed a few files to support the ARM7.

Right now you should be in cloud9/support/jsdav still so you’ll do the following to clone my fixed o3/node-libxml code and finish installing.

cd node_modules
git clone --recursive git://github.com/iancorbitt/node-libxml.git libxml
cd libxml
./build.sh

This is going to take a few minutes (~10 minutes), and depending on your GCC version, you’ll see a bunch of warnings/notes. It should compile fine, but comment if you get errors and I’ll do what I can.

Once it’s done, you’ll need to create a couple of folders and copy the o3.node binary. To do this, move back to your cloud9 folder and then:

mkdir -p support/jsdav/support/node-o3-xml-v4/lib/o3-xml/
cp support/jsdav/node_modules/libxml/support/o3/build/Release/o3.node support/jsdav/support/node-o3-xml-v4/lib/o3-xml/

You’re now done setting up Cloud9. You should be able to run it now:

node bin/cloud9.js

5) This step is optional, but I’m not going to delve into how to do this without doing it. Copy the copy of your node v0.4 binary to the cloud9 directory.

cd support/node-builds-v4 && cp ~/node-arm7l .

6) Use my guide to update NodeJS

7) If you’re using a init script to start Cloud9, make sure you tell it to run your node-arm7l binary to execute cloud9.js, otherwise it will not function. If you use Gentoo, you can use mine. If you’re not, and you’re doing it by hand, make sure you use that node v0.4.x binary to start Cloud9.

/usr/share/cloud9/support/node-builds-v4/node-arm7l bin/cloud9.js -l all -w  -e node

8) Being that you’re now using NodeJS v0.6.15, you are probably going to run into issues with broken node modules. I would highly suggest using npm to reinstall all of your modules, both locally and globally installed ones.

9) You now have access to the ever helpful -e runtime argument to tell Cloud9 to run a different node binary instead of just spawning a child process for running/debugging.

10) ??

11) Profit

6 comments

  1. eterps says:

    Awesome. Been searching for a solution to this problem on my MK802 for 2 days. Thanks!

  2. truedat101 says:

    This is indeed a nice description of the work needed to get this up on arm devices. Looks like this article needs an update, as latest Cloud9 has moved to this ‘sm’ (sourcemint) based module management.

    • Ian Corbitt says:

      Yea. I’ve been out deployed out to sea, so I haven’t been able to work with my Beaglebone for some time now. Once we get back, I’ll be able to work on it more.

  3. konfiot says:

    With a fresh version of C9, the cloud9/support/jsdav doesn’t exist anymore … Can you give an update of this procedure with the new version of the repo please ?

    • Ian Corbitt says:

      I’ll do what I can. I’ve been away from home for a while now, and haven’t had a chance to update it. I’ll post what I come up with.

      • konfiot says:

        I found myself, you just have to clone node_libxml into node_modules, then built node_libxml, then build c9 with npm install (and not sm install), when you’ll run c9 you will probably have errors about modules that aren’t installed, just install them with a npm install module_name

Leave a Reply

Your email address will not be published. Required fields are marked *