Node.js server debuging with WebStorm (grunt)

随声附和 提交于 2019-12-13 04:38:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!