title: How do I resolve "Cannot find module" error using Node.js?
body: <p>After pulling down a module from GitHub and following the instructions to build it, I try pulling it into an existing project using:</p>
  
  <pre><code>&gt; npm install ../faye
  </code></pre>
  
  <p>This appears to do the trick:</p>
  
  <pre><code>&gt; npm list
  /home/dave/src/server
  └─┬ faye@0.7.1
    ├── cookiejar@1.3.0
    ├── hiredis@0.1.13
    └── redis@0.7.1
  </code></pre>
  
  <p>But Node.js can't find the module:</p>
  
  <pre><code>&gt; node app.js
  node.js:201
          throw e; // process.nextTick error, or 'error' event on first tick
                ^
  Error: Cannot find module 'faye'
      at Function._resolveFilename (module.js:334:11)
      at Function._load (module.js:279:25)
      at Module.require (module.js:357:17)
      at require (module.js:368:17)
      at Object.&lt;anonymous&gt; (/home/dave/src/server/app.js:2:12)
      at Module._compile (module.js:432:26)
      at Object..js (module.js:450:10)
      at Module.load (module.js:351:31)
      at Function._load (module.js:310:12)
      at Array.0 (module.js:470:10)
  </code></pre>
  
  <p>I really want to understand what is going on here, but I'm at a bit of a loss as to where to look next. Any suggestions?</p>