Webstorm node.js远程debugging不会跳转到断点

我正在使用angular-fullstack生成器和Webstorm 10。

node.js远程debuggingconfiguration:

localhost: 127.0.0.1 port: 5858 

当我input“grunt serve:debug”时:

 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 

此时localhost:8080 / debug?port = 5858打开,然后启动我的node.js远程debugging器。 它说:

  Connected to localhost:5858 

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

那里有多个问题,与WebStorm,Grunt,Node本身有关…一般来说,为了能够debugging你的angular-fullstack应用程序的服务器端代码,我build议如下:

使用Node.js运行configuration来debugging:

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

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

 process.execArgv = []; 

这应该修复debuggingGruntsubprocess的问题 – 默认情况下,生成的subprocess使用与父进程相同的debugging端口 – 结果分叉进程被挂起,应用程序“停止”。 另外,打开node_modules \ grunt-express-server \ tasks \ lib \ server.js并将第71行更改为:

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

当使用–debug选项而不是–debug-brk产生subprocess时,WebStormdebugging器在进程启动时并不总是有时间注册断点,因此subprocess中的断点不会被命中。

指令是为使用generator-angular-fullstack@2.0.13生成的应用程序编写的; 你可能有不同的设置…