This morning I was working on a project and one of the modules I depended on had a small bug in it. As I was about to log an issue on the project’s github page I discovered that it was already fixed, just not yet released. I really wanted to push my changes out to our staging server and my build process relies on npm gathering all the dependencies my project needs, so I looked for ways to install through npm without much modification to my build process.
What I discovered could be considered an abuse of npm’s preinstall hook, but it works.
This brings in not just the module, but also all of the module’s transitive dependencies as well. This trick worked for me, but I’m still a little doubtful that this is considered the “right” way around the problem.
No tags

Tim Oxley · June 19, 2012 at 6:50 pm
You’ve probably moved on by now, but for your readers, a better way to solve this is probably:
“dependencies”: {
“socket-io-client”: “git://github.com/LearnBoost/socket.io-client.git#master”
}
More info:
http://www.devthought.com/2012/02/17/npm-tricks/
http://debuggable.com/posts/private-npm-modules:4e68cc7d-1ac4-42d9-995a-343dcbdd56cb
and under “Git URLs as Dependencies” in `npm help json`:
http://npmjs.org/doc/json.html#Git-URLs-as-Dependencies