问题
I'm using grunt to launch my server with livereload and other tasks. I've followed this and this post to run my grunt tasks. It's working but I can't debug properly (when I set some breakpoints, there aren't hit)
When I launch the script, here is what I got:

As you can see the debugger appears in a 2nd tab, but it's not doing anything. (even if it says it's connected successfully).
To debug my app I've to stop this 2nd tab, and run a remote debugger... Anyway to fix this?
Additional info: The server is run in another process. If I run it in the same process as grunt, there are no issues.
回答1:
What Node.js version do you use? In 0.10.x the child process occupies the same port as a master process, so debugging won't work by default. Related ticket: https://github.com/joyent/node/issues/5318. Can you check if it works for you using Node.js ersion >= 0.11.4? Also, what Grunt tasks are being used?
回答2:
As mentioned by lena, the issue seems to be fixed in WebStorm 8.
来源:https://stackoverflow.com/questions/21976584/node-js-server-debuging-with-webstorm-grunt