2015-10-26 132 views
1

我使用角fullstack发生器和Webstorm 10.Webstorm Node.js的远程调试不会跳到断点

Node.js的远程调试配置:

localhost: 127.0.0.1 
port: 5858 

当我输入“咕噜服务:调试“:

Debugger listening on port 5858 
Node Inspector v0.9.2 
Visit http://localhost:8080/debug?port=5858 to start debugging. 
Express server listening on 9000, in development mode 

此时本地主机:8080 /调试端口= 5858打开,然后我开始我的node.js远程调试器。它说:

Connected to localhost:5858 

然而,框架窗格是完全空白的,所有的断点都被忽略。

回答

1

有多个问题存在,涉及到WebStorm,咕噜,节点本身......在一般情况下,要能够调试角fullstack应用程序的服务器端代码,我建议如下:

使用Node.js的运行配置调试:

Working directory: your project root folder 
JavaScript file: path/to/node_modules/grunt-cli/bin/grunt 
Application parameters: serve 

以下行添加到您的Gruntfile.js的顶部;

process.execArgv = []; 

这应该可以解决问题调试步兵的子进程 - 默认情况下,产生了子进程使用相同的调试端口作为父进程 - 结果叉形过程被暂停,并且应用程序的档位“。 此外,开放node_modules \咕噜-Express的服务器\工作\ LIB \ server.js和变线71:

options.opts.unshift('--debug-brk'); 

当一个子进程产生与--debug选项,而不是--debug-BRK ,WebStorm调试器在进程启动时并不总是有时间注册断点,因此子进程中的断点不会被命中。

指令是为使用[email protected]生成的应用程序编写的;你可能有不同的设置...

相关问题