question

Sammy Zimmermanns avatar image
Sammy Zimmermanns asked

Cannot find module 'ask-sdk-core'

All the installations went fine locally but when I tried to simply copy the memory challenge example into the lambda console, testing failed with this error:

"errorMessage": "Cannot find module 'ask-sdk-core'"

The example code is below.

I have stricktly used the instrauction for the alexa sdk v2 tutorial on github.

alexa skills kitnodejssdk v2
code.jpg (100.0 KiB)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sammy Zimmermanns avatar image
Sammy Zimmermanns answered

I have found the error. Some node modules were missing, so i have to install all modules new via npm install. See here: https://ask-sdk-for-nodejs.readthedocs.io/en/latest/Setting-Up-The-ASK-SDK.html

So if you use the template for fact skills in your aws, there are no all required modules installed.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Robert G Schaffrath avatar image
Robert G Schaffrath answered

When I first started developing Skills using templates, I discovered that my package.json files were not always correctly populated. When I eventually did an "npm update" to one of my Skill's, most of my installed packages were wiped out. That is when I had to search and learn the mysteries of "npm". The solution was to go and do an "npm install alexa-sdk --save" as well as a few other core modules to get everything working correctly. Sometimes forgetting that "--save" will come back to haunt you.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.