Skip to content

Instantly share code, notes, and snippets.

@bitflower
Created June 19, 2015 13:37
Show Gist options
  • Save bitflower/fe22c7acd99eb2336ff7 to your computer and use it in GitHub Desktop.
Save bitflower/fe22c7acd99eb2336ff7 to your computer and use it in GitHub Desktop.
Heroku setup
(Source: http://stackoverflow.com/questions/18466943/how-can-i-get-rid-of-error-cannot-find-module-models-on-heroku)
You need to set NODE_PATH=lib to heroku's configuration variables.
NODE_PATH tells node where to find modules besides node_modules directory.
Also, you need to tell the app to read env variables in a production environment.
So...
$ heroku config:set NODE_ENV=production
$ heroku config:set NODE_PATH=lib
There is no need to modify any file for a heroku deployment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment