title: aws lambda layer shared library in node_modules not accesible in function
body: <p>I recently changed my lambda functions to use the new aws Lambda Layer functionality, to share all the node_modules folder. I created the zip with the following structure:</p>
  
  <pre><code>nodejs/node_modules/&lt;libraries, like 'async' and others..&gt;
  nodejs/package.json
  </code></pre>
  
  <p>I also linked the lambda function to the layer, and it succeed (checked both in the CLI and in the web console), see output below.. 
  but anyway, always the lambda function fails on the require:</p>
  
  <pre><code>in lambda: require('async')
  
  output: "errorMessage":"Cannot find module 'async'"
  </code></pre>
  
  <p>output of the update-function call: </p>
  
  <pre><code>aws lambda update-function-configuration --function-name MY_LAMBDA --layers arn:aws:lambda:us-west-2:MY_ID:layer:MY_LAYER:4
  {
  "Layers": [
  {
  "CodeSize": 21482560,
  "Arn": "arn:aws:lambda:us-west-2:MY_ID:layer:MY_LAYER:4"
  }
  ],
  "FunctionName": "MY_LAMBDA",
  "LastModified": "2018-12-18T23:44:34.062+0000",
  "RevisionId": "f55a6ab7-7b0b-494a-840c-87fb8371a117",
  "MemorySize": 128,
  "Version": "$LATEST",
  "Role": "arn:aws:iam::MY_ID:role/service-role/MY_ROLE",
  "Timeout": 30,
  "Runtime": "nodejs4.3",
  "TracingConfig": {
  "Mode": "PassThrough"
  },
  "CodeSha256": "hajYdqb+...=",
  "Description": "",
  "VpcConfig": { ... lot of stuff here .. },
  "CodeSize": 429123,
  "FunctionArn": "arn:aws:lambda:MY_ZONE:MY_ID:function:MY_LAMBDA",
  "Handler": "MY_HANDLER"
  }
  </code></pre>
  
  <p>notes: 
  1. my layer is in version 4. 
  2. I set the layer to all three node.js environments for support. 
  3. I checked the zip and it has all the node_modules content as expected.</p>
  
  <p>any suggestion about what else to check is welcomed!</p>