Search code examples
webstorm

Webstorm node.js cli debugging in windows 7


A noob needs a favour from you. I am writing a node.js cli application that has to run in a windows 7 cmd.exe. I can not figure out how to set up a debugging workflow that I am comfortable with. When I use the standard node.js debugging config, it debugs in the Webstorm console (ie. in the ide, which does not seem to accept input from stdin - and yes, stdin has been resumed). What I would like to achieve is to have it run the application in an external cmd.exe (which is what the app will be run in), and still be able set breakpoints etc in the ide. I do not want to run the app in the Webstorm internal console.

I am using Webstorm 11 and node 4.2.1.

Many thanks


Solution

  • To enable stdin in WebStorm debugger console, in the Console tab uncheck "Use Console Input" — https://dl.dropboxusercontent.com/u/43511007/s/Screen%20Shot%202015-04-30%20at%2014.45.54.png.

    You can also run your application in cmd console with --debug=<port for debugging> or --debug-brk=<port for debugging> options and attach to it using Remote Node.js Debug configuration. See https://confluence.jetbrains.com/display/WI/Running+and+debugging+Node.js+application#RunninganddebuggingNode.jsapplication-DebuggingNode.jsappthatrunsremotely