AWS Lambda Error: “Cannot find module '/var/task/index'”

后端 未结 9 1728
忘掉有多难
忘掉有多难 2020-12-23 02:54

Node.js Alexa Task Issue

I\'m currently coding a Node.js Alexa Task via AWS Lambda, and I have been trying to code a function that receives informat

9条回答
  •  心在旅途
    2020-12-23 03:26

    Update to the accepted answer: When this error occurs, it means your zip file is not in the valid form which AWS requires.

    If you double click on zip you will find your folder inside that your code file,but lambda wants that when you double click on zip it shoud show direct code files.

    To achieve this:

    open terminal  
    cd your-lambda-folder 
    zip -r index.zip *
    

    Then, upload index.zip to AWS Lambda.

提交回复
热议问题