heroku/heroku-buildpack-nodejs — Issue #6: support bundled dependencies
Author: isaacs
Created: 2012-01-01 18:35:21+00:00
State: open

It looks like the bin/compile script is explicitly removing any node_modules directory that comes along with the git push. This is exactly the wrong thing for a deployment tool to do. Here's a great explanation of some of the reasons why: http://www.mikealrogers.com/posts/nodemodules-in-git.html

Here's what the thing should do:

1. check out the received pack from git, node_modules and all.
2. in the checkout dir, do `npm install` with no arguments, to install any missing deps locally.
3. Do `npm rebuild` for any bundled modules that need to be compiled for the different architecture.