Note that there are some explanatory texts on larger screens.

plurals
  1. POHeroku can't find local module on heroku (Node.js)
    primarykey
    data
    text
    <p>I'm working on a Node.js app, and am using a <em>config.js</em> file that exposes my twitter API tokens/secrets. I'm doing this because I plan on open-sourcing the application after I finish it, and would like to keep those private (and thus, have put that file in my <code>.gitignore</code>.</p> <p>Anyways, to my question - I'm getting the following error log:</p> <pre><code>2012-04-09T22:41:12+00:00 app[web.1]: node.js:134 2012-04-09T22:41:12+00:00 app[web.1]: ^ 2012-04-09T22:41:12+00:00 app[web.1]: throw e; // process.nextTick error, or 'error' event on first tick 2012-04-09T22:41:12+00:00 app[web.1]: Error: Cannot find module './config' 2012-04-09T22:41:12+00:00 app[web.1]: at require (module.js:348:19) 2012-04-09T22:41:12+00:00 app[web.1]: at Function._load (module.js:266:25) 2012-04-09T22:41:12+00:00 app[web.1]: at Function._resolveFilename (module.js:320:11) 2012-04-09T22:41:12+00:00 app[web.1]: at Object.&lt;anonymous&gt; (/app/app.js:6:19) 2012-04-09T22:41:12+00:00 app[web.1]: at Module._compile (module.js:404:26) 2012-04-09T22:41:12+00:00 app[web.1]: at Object..js (module.js:410:10) 2012-04-09T22:41:12+00:00 app[web.1]: at Function._load (module.js:297:12) 2012-04-09T22:41:12+00:00 app[web.1]: at EventEmitter._tickCallback (node.js:126:26) 2012-04-09T22:41:12+00:00 app[web.1]: at Module.load (module.js:336:31) 2012-04-09T22:41:12+00:00 app[web.1]: at Array.&lt;anonymous&gt; (module.js:423:10) 2012-04-09T22:41:13+00:00 heroku[web.1]: State changed from starting to crashed 2012-04-09T22:41:13+00:00 heroku[web.1]: Process exited with status 1 </code></pre> <p>My file name is <code>config.js</code>, and I am doing a: <code>var config = require('./config')</code> in my app. I don't have it listed as a dependency in my <code>package.json</code> file, since it's not in NPM.</p> <p>Running locally with foreman and the Procfile (like heroku's docs say to do) work great. But, I'm confused why it's giving me an error when I'm requiring a local file. <code>config.js</code> is in the same directory level as my <code>app.js</code> is, so the path to require it is correct.</p> <p><strong>EDIT</strong>: Below is the portion of code I am using in <code>app.js</code>:</p> <pre><code>var express = require('express') , sys = require('sys') , request = require('request') , config = require('./config') </code></pre> <p>Thanks - Any help would be greatly appreciated!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload