Friday, March 9, 2018

Debug inside of a Node process with Visual Studio Code 1.17.2.

  1. Open the appropriate folder in Visual Studio Code.
  2. At the vertical row of five icons at the upper left for Explorer, Search, Source Control, Debug, and Extensions click on: Debug
  3. Click on the gear icon with a red dot at its upper right (or there may not be a red dot too) at the top nav to create a launch.json file.
  4. Change the path in the launch.json file to the .js file you would normally run by name by just preceding it's name with "node" and a space at a Windows 7 command prompt.
  5. Put debugger; as a line of code in your code base.
  6. Click the green go arrow up by the gear icon to debug and see if you can stop at your debugger; line.

No comments:

Post a Comment