0
votes

I'm new to Alexa Skill development and I'm sure this issue is process/environmental due to lack of experience.

Whenever I try to use a sample from an offical Alexa tutorial, I can never get the skill to pass the first TEST - always getting an error :(

In this case I am trying to run and fiddle with this tutorial: https://developer.amazon.com/blogs/post/TxHGKH09BL2VA1/New-Alexa-Skills-Kit-Template-Step-by-Step-Guide-to-Build-a-Decision-Tree-Skill

What is happening / What I've done:

  • I download the Node SDK from the Git link, I also download the sample from the Git link. I then create a new ZIP that contains the sample code with the Node SDK included in the path /src/alexa-sdk/

  • I go to AWS and create a new function, not using a blueprint. I 'author from scratch' and create a function with the Skills Kit as a trigger. I name the function and use Node 6.10 runtime.

  • I upload my ZIP file and leave all boxes default, for Role I choose Custom Role then pick Basic Execution from the Role screen.

  • I leave the rest blank, go to NEXT and CREATE.

The function is created okay, but I do see this error 'This function contains external libraries. Uploading a new file will override these libraries.'

Here's the problem - this is the point of failure on all tutorials I've tried so far. I go to Configure Test Event, I choose ALEXA START SESSION as the template and click Save And Test...

EXECUTION RESULT FAILED:

{
  "errorMessage": "Cannot find module '/var/task/index'",
  "errorType": "Error",
  "stackTrace": [
    "require (internal/module.js:20:19)"
  ]
}

Here's something from associated error logs, unsure if it's useful:

Unable to import module 'index': Error
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)

I have noticed two things that I suspect may be an issue:

1) When I go to the CODE tab for this function, I see this message:

Your Lambda function "testprojectx" cannot be edited inline since the file name specified in the handler does not match a file name in your deployment package.

2) When I look at the code that's inserted into the test when I choose ALEXA SESSION START, I see many instances of 'unique value here':

amzn1.echo-api.session.[unique-value-here]

Although, there is no mention of this in the tutorial link I am referencing.

I'm really downhearted about it now as this is like the 3rd tutorial code I've tried to configure. Can anybody with experience follow the steps I've taken and point me in the right direction.

Thank you SO MUCH in advance if so.

EDIT: Absolute Clarification on how I am creating the ZIP file I'm using Windows 10 and Chrome to download the files from GitHub.

  • I download the skill-sample-nodejs-decision-tree-master ZIP file from GitHub,
  • I do not know how to use NPM so I do this simply via downloading to desktop.
  • I then download the alexa-skills-kit-sdk-for-nodejs-master.ZIP file to desktop.
  • I unzip the contents of decision-tree-master into a folder on the desktop also called alexa-skills-kit-sdk-for-nodejs-master.
  • Within this folder, I navigate to /src/ and create a new folder called 'node_modules' within /src/.
  • Within /src/node_modules/ I now create another new folder called 'alexa-sdk'.
  • I unzip the contents of alexa-skills-kit-sdk-for-nodejs-master.zip into /src/node_modules/alexa-sdk/.

I have tried two approaches from here - both fail:

1) I ZIP only the contents of /src/ (not including the /src/ folder itself) and upload to Amazon.

2) I ZIP the entire 'decision-tree-master' folder and upload to Amazon.

I must be missing something, as I said this is just one of many Alexa tutorials I've tried to get working and this always happens :( So disheartened now.

1
Does my answer help to sort out the issue?Vijayanath Viswanathan

1 Answers

0
votes

This is common issue I have seen in many posts. Most of the cases it is the way zipping the files making the problem. Instead of zipping the folder you have to select all files and zip it like below,

enter image description here