How to quickly deploy a node app which uses slow-building binary modules?

I have a few applications which use the fantastic node-sqlite3 module. Its one drawback is that it builds sqlite from source when it's installed. This is compounded by the way I do deployment; I'm using chef, which gives me a clean source tree for every deploy. I then do an npm install at each application root. This isn't a problem for most things since it just hits the local cache. But for sqlite3, it builds a whole new copy for each place the module is referenced; 4 times in my case! What would take seconds now takes minutes, which especially sucks when testing out new changes in a staging environment.

In principle, I should be able to do a build once for a given version of the module, cache it, and just copy or link in the binary on deployment. Has anybody done something similar? Are there demons lurking here?

We have a similar setup with Node.js on Chef here and chose to install sqlite3 globally. The Node.js style guide recommends against doing this, but it seems preferable to recompiling sqlite3 for minutes every deploy:

In chef or your package.json you have something like

(sudo) npm install -g sqlite3@2.1.x

Ensure that you add the global NODE_PATH into your init script.

node NODE_PATH=/usr/local/lib/node_modules app.js