Installing Canvas for Node on OSX

I’d like to work with Processing.js, but I had trouble installing the canvas dependency. This should be as easy as,

$ npm install canvas

But there’s a thingy that doesn’t work in Homebrew. I found the answer in this thread on their GitHub. On OSX you have to call this command before you can install canvas:

$ export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig

Then we can install canvas and processing using npm like we’d expect.