AWS Lambda: Unable to import module

后端 未结 6 1157
误落风尘
误落风尘 2021-02-05 13:12

please forgive me, I am totally new at Lambda and Node.

I am trying to replicate this git to order a pizza using an AWS IoT button.

My current code is:

<

6条回答
  •  生来不讨喜
    2021-02-05 13:44

    In my case, i mentioned Handler as index.handler but my root filename is app.js. Changing this to index.js worked.

    Also make sure the zip file has your index.js, node_modules and package.json directly.

    Should be:

    zip file --> index.js
                 package.json
                 node_modules
    

    Not

    zip file --> some_folder_name --> index.js
                                      package.json
                                      node_modules
    

提交回复
热议问题