Debugging Alexa Skills in VS Code

  1. Install the Alexa Skills Kit Toolkit:

  2. Download your code from the Alexa Developer console Skill Code to VS Code

  3. Install the local debug package

npm install 
npm install --save-dev ask-sdk-local-debug
  1. Create a launch.json file by clicking the run and debug icon on the left toolbar an clicking the create launch.json link
  2. Include the Alexa configuration to the launch.json file Launch.json configuration

(Note, the last part of this config had the region set to NA. I had to change this to EU to get it to work in my case)

Example Launch.json:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug Alexa Skill (Node.js)",
            "type": "pwa-node",
            "request": "launch",
            "program": "${command:ask.debugAdapterPath}",
            "args": [
                "--accessToken",
                "${command:ask.accessToken}",
                "--skillId",
                "${command:ask.skillIdFromWorkspace}",
                "--handlerName",
                "handler",
                "--skillEntryFile",
                "${workspaceFolder}/lambda/index.js",
                "--region",
                "NA"
            ],
            "cwd": "${workspaceFolder}/lambda"
        }
    ]
}
  1. Run, Start Debugging

From here you can set breakpoints in your code and hit them by invoking the intent using and Echo device or using the simulator in the skills kit.