title: "required is not defined" in packaged AWS Lambda Function
body: <p>I am attempting my first packaged AWS Lambda function which is currently failing and returning "required is not defined" in the logs.</p>
  
  <p>Initially in the function, I am looking to just get a simple node command to return a json file from a Google Sheet using an npm module. From my ec2 instance which has <code>gsjson</code> installed, this is very easy. I just type:</p>
  
  <pre><code>gsjson 1KIg84G9CXErw2bWhkEHWUkOI4CR-biFeLqCtdypaLU8 fruits.json
  </code></pre>
  
  <p>[![EC2 NodeJS - gsjson][1]][1]</p>
  
  <p><a href="https://www.npmjs.com/package/gsjson" rel="nofollow noreferrer">https://www.npmjs.com/package/gsjson</a></p>
  
  <p>The packaged zip file I uploaded contains an index.js file and a node modules folder containing the google-spreadsheet-to-json npm module from GitHub.</p>
  
  <p>Here is the index.js code:</p>
  
  <pre><code>var gsjson = require('google-spreadsheet');
  
  exports.handler = function(event, context) {
      'gsjson 1KIg84G9CXErw2bWhkEHWUkOI4CR-biFeLqCtdypaLU8 fruits.json';
  }
  </code></pre>
  
  <p><strong>UPDATE</strong>: After adjusting the typo, the error message is now </p>
  
  <pre><code>"errorMessage": "Cannot find module 'google-spreadsheet'",
  </code></pre>
  
  <p><strong>UPDATE 2 - SUCCESS</strong>: Although the npm module is called gsjson and npm folder google-spreadsheet-to-json. The require must reference "google-spreadsheet". Edited code above</p>