Lambda create Handlers Object


#1

When I have the correct code in creating handlers object lesson it gives me an error about "alexa-sdk"
code:

"use strict";

// Include the Alexa SDK
var Alexa = require("alexa-sdk");

// The handlers object tells Alexa how to handle various actions
var handlers = {
  
};

Error:
module.js:472
    throw err;
    ^

Error: 

Cannot find module 'alexa-sdk'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at Module.requireProxy (/home/ccuser/node_modules/rewire/lib/moduleEnv.js:46:24)
    at require (internal/module.js:20:19)
    at index.js:4:13
    at Object.<anonymous> (index.js:7:1)
    at Module._compile (module.js:571:32)
    at loader (/home/ccuser/node_modules/babel-register/lib/node.js:158:5)
    at Object.require.extensions.(anonymous function) [as .js] (/home/ccuser/node_modules/babel-register/lib/node.js:168:7)
    at Module.load (module.js:488:32)
    at Object.load (/home/ccuser/node_modules/rewire/lib/moduleEnv.js:20:18)
    at internalRewire (/home/ccuser/node_modules/rewire/lib/rewire.js:57:15)
    at rewire (/home/ccuser/node_modules/rewire/lib/index.js:11:12)
    at Object.<anonymous> (test.js:3:17)
    at Module._compile (module.js:571:32)
    at loader (/home/ccuser/node_modules/babel-register/lib/node.js:158:5)
    at Object.require.extensions.(anonymous function) [as .js] (/home/ccuser/node_modules/babel-register/lib/node.js:168:7)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at /home/ccuser/node_modules/mocha/lib/mocha.js:220:27
    at Array.forEach (native)
    at Mocha.loadFiles (/home/ccuser/node_modules/mocha/lib/mocha.js:217:14)
    at Mocha.run (/home/ccuser/node_modules/mocha/lib/mocha.js:469:10)
    at Object.<anonymous> (/home/ccuser/node_modules/mocha/bin/_mocha:404:18)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)
    at bootstrap_node.js:542:3

any ideas?


#2

I had the same issue. It’s possible that Codecademy has improperly added the alexa-sdk module. I recommend continuing using the “spam the run button” strategy, if possible.


#3

I just tried this myself and didn’t experience this error. Is there any more that you / anyone can tell me about this issue? Does the get code button fix your problem? Can you send me a screenshot too?


#4

Get Code fixed it when I had the issue. It changed no code, but passed conditions. Having passed the exercise, I no longer have any problems.

Are you able to provide a screenshot @cloudace08682