technology

Cross Compiling Node.js for ARM on Ubuntu

Node.js is available for many different operating systems and architectures. We can run it on our Macbooks locally, on full server grade systems, and on IoT devices with ease. The Node Foundation publishes binary tarballs for a broad spectrum of target platforms. Over at NodeSource we package those builds up for Linux to make them easy to install. However, building Node.js for architectures other than Intel x86 or x64 can be very time-consuming. A clean build of a release from the 10.x line on a Raspberry Pi 3 takes around five hours. It would be nicer if we could cross compile from a beefy Intel machine with the target being the ARM chips that are used in the Raspberry Pi. This is possible, but not as easy as I would have thought when using a recent 64bit Ubuntu system. I spent the better part of my Friday night figuring out exactly how to do it, so I thought I’d share what I learned so you don’t have to jump through all of the hoops I did.

Joining Forces With NodeSource

If you’re reading this blog, then there’s a good chance that you make use of my PPA for Node.js. I started making Node packages several years ago because I wanted there to be a consistent way for people to install up-to-date versions of Node on their machines. Not too long ago, Dan Shaw reached out to me to ask if there was anything he could do to help with the PPAs and give back to the effort. I had been looking for a way to ensure that what I’m doing satisfies the needs of Node developers, and also to make sure the project continues to receive the support it needs. We talked about how best to make this happen and decided to move things over to NodeSource from Launchpad. Here’s why.

Upgrading from Node.js 0.8.x to 0.10.0 From my PPA

The Node.js project recently pushed out a new stable version with the 0.10.0 release. This release supersedes the 0.8.x line and has a bunch of new features and enhancements. In particular, there’s a new Streams API you’ll probably want to check out. Also, the domain module has been elevated to “unstable” status, so you can start checking it out for your error handling. A lot of people seem to use my node PPA to install node on their systems, so I wanted to make a quick note about performing this upgrade.

Navigate