Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here are the steps to load npm modules in AWS Lambda:

  1. Create a new Lambda function or open an existing one.
  2. In the Code tab, select the "Upload a .zip file" option.
  3. Locate the directory on your local machine where your Lambda function code is stored.
  4. Select all the files in that directory and compress them into a .zip file.
  5. Upload the .zip file to the Lambda function.
  6. Once the .zip file is uploaded, expand the "Code entry type" dropdown and select "Edit code inline".
  7. In the inline editor, navigate to the "Dependencies" tab.
  8. In the "Dependencies" tab, click on the "+" button and enter the name of the npm module you want to include.
  9. Click the "Save" button at the top of the editor.
  10. Test your Lambda function to ensure the module has been loaded correctly.