skill-sample-nodejs-berry-bash icon indicating copy to clipboard operation
skill-sample-nodejs-berry-bash copied to clipboard

Cannot Find Module "ask-sdk"

Open mbrewster7 opened this issue 7 years ago • 2 comments

Hi, when testing this in the Developer Portal and in Lambda, I am coming up with an error launching.

From Lambda: { "errorMessage": "Cannot find module 'ask-sdk'", "errorType": "Error", "stackTrace": [ "Function.Module._load (module.js:417:25)", "Module.require (module.js:497:17)", "require (internal/module.js:20:19)", "Object. (/var/task/index.js:12:15)", "Module._compile (module.js:570:32)", "Object.Module._extensions..js (module.js:579:10)", "Module.load (module.js:487:32)", "tryModuleLoad (module.js:446:12)", "Function.Module._load (module.js:438:3)" ] }

Log Output:

START RequestId: 0bf41842-b51f-11e8-a476-8163611deecf Version: $LATEST Unable to import module 'index': Error at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/var/task/index.js:12:15) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) END RequestId: 0bf41842-b51f-11e8-a476-8163611deecf REPORT RequestId: 0bf41842-b51f-11e8-a476-8163611deecf Duration: 67.58 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 19 MB

This is my first coding experience, so I'm not quite sure what it isn't finding and how to fix it.

mbrewster7 avatar Sep 10 '18 17:09 mbrewster7

maybe you forgot to do npm install before to send folder to lambda

dragouf avatar Sep 26 '18 01:09 dragouf

I think that the problem is that the instructions tell you to set up the Lambda function using the alexa-skill-kit-sdk-factskill Blueprint, then replace index.js with the one from this repository. This template uses V2 of the SDK, while the Blueprint may use V1. The Blueprint is considered obsolete, and probably hasn't been updated.

If you use the ASK CLI to deploy, it doesn't use the Blueprint to set up the Lambda function, and everything seems to work.

This may also be the cause of some of the other issues posted.

alee67 avatar Nov 07 '18 12:11 alee67