0

So I've created a lambda function which was developed in SAM. Now when I've pushed all the code to the lambda function however when I trigger it it seems like it doesn't install the necessary dependencies like mysql etc

Shouldn't it automatically npm install all the required libraries? Or do I need to manually push the node_modules dir to the lambda function as well?

1 Answer 1

2

You need to include the node_modules bundleded with your lambda function.

Lambda executes the code straight away without an install step.

https://docs.aws.amazon.com/lambda/latest/dg/nodejs-create-deployment-pkg.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.