Skip to content

Instantly share code, notes, and snippets.

@andrewfulton
Created May 11, 2019 23:22
Show Gist options
  • Save andrewfulton/ebc34ba28dda528d0b1367ad5adbaf1e to your computer and use it in GitHub Desktop.
Save andrewfulton/ebc34ba28dda528d0b1367ad5adbaf1e to your computer and use it in GitHub Desktop.
Debug setup for node/VSCode

Works for generally running node script and inside express etc callbacks.

Need to make sure that port in launch.json and --inspect-brk=X in package.json match.

{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch via NPM",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"debug",
],
"port": 9229
},
]
}
{
"name": "debug",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"debug": "node --inspect-brk=9229 index.js"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment