Debug Node.js application in VSCode!

  • Open and Update VS Code

  • Open your Node.js application
  • Enable auto attach:
  • Ctrl + Shift + P on Windows or ⌘ + ⇧ + P on Mac
  • Search for “Debug: Toggle Auto Attach
  • Select to toggle

  • Add breakpoints in VSCode by clicking on left margin of editor.

  • Run Node.js app with inspect switch

    node hello.js --inspect-brk

    Done, check the clock :)