2

I'm trying to build an Alexa prototype for a client using this tutorial : https://developer.amazon.com/public/community/post/Tx3DVGG0K0TPUGQ/New-Alexa-Skills-Kit-Template:-Step-by-Step-Guide-to-Build-a-Fact-Skill

I am getting errors when I upload the zip file with the Alexskill.js and index.js files in it. I believe these are in the system itself and nothing to do with my code. Here is a screen grab of my browser console:

https://developer.amazon.com/public/community/post/Tx3DVGG0K0TPUGQ/New-Alexa-Skills-Kit-Template:-Step-by-Step-Guide-to-Build-a-Fact-Skill

There's no way to see if the zip file you upload has been successful (frustrating) - but this looks bad right?

Obviously, when I try and test the lambda function I get this error:

{
  "errorMessage": "Cannot find module 'index'",
  "errorType": "Error",
  "stackTrace": [
    "Function.Module._load (module.js:276:25)",
    "Module.require (module.js:353:17)",
    "require (internal/module.js:12:17)"
  ]
}

I desperately need to get this working. Has anyone got the code in one file that I can use to do this using the inline code editor? I am using the FactSkill demo which is very basic.

1 Answer 1

3

This is one of those 'I want to kick myself around the room' moments. In this article it tells you to download the ZIP archive from GIT and then upload it to the lambda control panel. When you do that on a mac it unzips it into a folder for you. I then zipped that folder back up and uploaded it. That was my problem ...

You need to zip the two files inside the folder and not the folder itself!

Then it can see the module from the archive.

DOH!!!

But, still ... Amazon, wtf is going on with all those errors?

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

1 Comment

Yep. That's what I figured it was, but you worked it out yourself. There is the same problem with Java Lambda functions that people run into all the time as well. It is very particular about the zip file format.

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.