Skip to content

Instantly share code, notes, and snippets.

@kkroesch
Last active April 18, 2016 12:12
Show Gist options
  • Save kkroesch/04652fb6c63f5ca2c100fe4cf2472f91 to your computer and use it in GitHub Desktop.
Save kkroesch/04652fb6c63f5ca2c100fe4cf2472f91 to your computer and use it in GitHub Desktop.
Failsafe setting of NODE_PATH in scripts. Put this line before importing your own modules to avoid statements like `require('../../middleware')'.
process.env.NODE_PATH || (process.env.NODE_PATH = __dirname)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment