- Le plus récent
- Le plus de votes
- La plupart des commentaires
The error you're encountering suggests that AWS Lambda is unable to find the axios module, and it's looking for it in a directory that does not exist, such as 'opt/nodejs/axios'. This issue might be related to how you've bundled and deployed your Lambda function.
To resolve this issue, you can follow these steps:
-
Check Dependencies: Ensure that axios is properly added to your Lambda function's deployment package. In your AWS CDK project, make sure that axios is listed as a dependency in your package.json file.
-
Bundling: When you deploy a Lambda function with dependencies, it's essential to bundle the function with its dependencies. You can use tools like AWS SAM, Serverless Framework, or AWS CDK to help with bundling. Make sure your bundling process includes the node_modules directory.
-
Build Lambda Function: Before deploying, ensure that you build your Lambda function with the bundled dependencies and package it correctly.
Contenus pertinents
- demandé il y a un an
- demandé il y a 2 mois
- AWS OFFICIELA mis à jour il y a 3 ans
- AWS OFFICIELA mis à jour il y a 4 mois
- AWS OFFICIELA mis à jour il y a 4 mois
I found out if I remove the node_modules folder from git_ignore file, everything will work..., but it is a big folder, Can I really ignore it ?