Thought I’d throw this out there for those who are new to node.js or just in general new to deploying apps to heroku, but here’s how to bundle dependencies via npm for deployment to heroku (or even for any kind of redistribution in general).
Given that you have defined the dependencies of your project in the package.json file like this:
If you want to bundle the dependencies with your app simply create a directory (any should work, but I prefer ./vendor) and run npm bundle ./vendor. You should also probably use the latest npm (I update it weekly) as I know the feature was added shortly before last weekend’s Node Knockout. If everything goes well all the 3rd party dependencies you rely on should be downloaded to the vendor directory… if not I guess you could post a request for help on the mailing list.
Now to get these included in your app via require, just add the vendor path to your require paths and you’re ready to go. I normally do this at the top of my server.js file:
Then you can just do your painless deployments to joyent or heroku, carefree. Have fun!

