title: node_module errors with AWS lambda, what's the best practice for dependencies?
body: <p>I've been trying to convert and deploy one of our node.js apps into a lambda function and have been having some problems with the node_modules dependencies - saying that it can't find certain modules.  I started by creating a package.json, npm install the dependencies locally then copy the node modules folder up to lambda.</p>
  
  <p>For instance I have a project that requires sequelize and convict and have been getting errors saying that it cannot find the moment module as a sub-dependency.  I see that moment is included in the root of my node_modules but it was not included in the sub folder under the sequelize module.</p>
  
  <p>However, this project runs fine locally.  What is the difference in lambda and what's the best practice for deploying a somewhat long list of node modules with it - just a copy of the node_modules folder?  On some of the other simpler projects I have, the small amount of node_modules can be copied up with no problems.</p>
  
  <pre>
  {
    "errorMessage": "Cannot find module 'moment'",
    "errorType": "Error",
    "stackTrace": [
      "Function.Module._resolveFilename (module.js:338:15)",
      "Function.Module._load (module.js:280:25)",
      "Module.require (module.js:364:17)",
      "require (module.js:380:17)",
      "VERSION (/var/task/node_modules/sequelize/node_modules/moment-timezone/moment-timezone.js:14:28)",
      "Object. (/var/task/node_modules/sequelize/node_modules/moment-timezone/moment-timezone.js:18:2)",
      "Module._compile (module.js:456:26)",
      "Object.Module._extensions..js (module.js:474:10)",
      "Module.load (module.js:356:32)",
      "Function.Module._load (module.js:312:12)"
    ]
  }
  </pre>