Should I check in node_modules to git when creating a node.js app on Heroku?

These instruction don't tell you to create a .gitignore node_modules, and therefore imply that node_modules should be checked in to git. When I include node_modules in git my getting started application ran correctly.

Running "heroku ps" confirms the crash. Ok, no problem, so I rolled back the change, add node_module back to the git repository and removed it from .gitignore. However, even after reverting, I still get the same error message on deploy but now the application is running correctly again. Running "heroku ps" tells me the application is running.

So my question is what's the right way to do this? Include node_modules or not? And why would I still be getting the error message when I rollback? My guess is the git repository is in a bad state on the Heroku side?

Second Update

If you wish to lock down the specific bytes included in a package, for example >to have 100% confidence in being able to reproduce a deployment or build, then >you ought to check your dependencies into source control, or pursue some other >mechanism that can verify contents rather than versions.

Shannon and Steven mentioned this before but I think, it should be part of the accepted answer.

Update

The source listed for the below recommendation has been updated. They are no longer recommending the node_modules folder be committed.

Usually, no. Allow npm to resolve dependencies for your packages.

For packages you deploy, such as websites and apps, you should use npm
shrinkwrap to lock down your full dependency tree:

Original Post

For reference, npm FAQ answers your question clearly:

Check node_modules into git for things you deploy, such as websites
and apps. Do not check node_modules into git for libraries and modules
intended to be reused. Use npm to manage dependencies in your dev
environment, but not in your deployment scripts.