How can I install node addon system wide that is compiled by node-gyp install?

I am on Ubuntu 14.04 32 bit platform. I am trying to install link-grammar tool here https://github.com/dijs/link-grammar with command

sudo npm install -g link-grammar

Unfortunately it fails due to an error while installing one of its dependency ref When I try to install it like

sudo npm install -g ref

it fails but if I clone it from here https://github.com/TooTallNate/ref into my local disk and compile it with

node-gyp install 

it compiles into source directory successfully

How can I install that module system wide to let it use as dependency to link-grammar?