title: AWS Lambda can't find my module
body: <p>I am trying to do a simple require of my own lib in AWS Lambda, but it can't find it. What am I missing?</p>
  
  <pre><code>var a = require('./lib/a');
  
  exports.handler = function(event, context, callback) {
      callback(null, 'Testing');
  
  }
  </code></pre>
  
  <p>Yeah, this works when testing it locally, but not when zipped and deployed. I am zipping just the file, not the directory and removing the require makes it work.</p>
  
  <pre><code>{
    "errorMessage": "Cannot find module './lib/a'",
    "errorType": "Error",
    "stackTrace": [
      "Function.Module._load (module.js:417:25)",
      "Module.require (module.js:497:17)",
      "require (internal/module.js:20:19)",
      "Object.&lt;anonymous&gt; (/var/task/index.js:1:77)",
      "Module._compile (module.js:570:32)",
      "Object.Module._extensions..js (module.js:579:10)",
      "Module.load (module.js:487:32)",
      "tryModuleLoad (module.js:446:12)",
      "Function.Module._load (module.js:438:3)"
    ]
  }
  </code></pre>
  
  <p>Directory structure:
  index.js
  lib/a.js</p>