2015-03-31 62 views
2

我试着用node-inspector来调试我的节点应用程序。起初,我用“node-debug index.js”和“run node-inspector,then node --debug index.js”有什么区别?

node-debug index.js 

但检查员debugger声明不会停止,还我无法设置断点。

但是,如果我跑

node-inspector 

然后用调试标志

node --debug index.js 

检查员就像一个魅力运行节点。

那么这两者有什么区别?我尝试阅读https://github.com/node-inspector/node-inspector/blob/master/bin/node-debug.js但坦率地不明白:O

非常感谢!

我使用的Mac OSX 10.10.2

回答

1

基本上,节点调试加载节点检查也设置了一些默认配置。
this statement在文档While running node-debug is a convenient way to start your debugging session, there may come time when you need to tweak the default setup.

的完整列表是什么预装是那种很难搞清楚(我不知道的分歧任何真正上市)。但是如果你真的阅读文档,你可以得到一个想法。
节点调试

>Debug 
The node-debug command will load Node Inspector in your default browser. 


>The debugged process must be started with --debug-brk, this way the script is paused on the first line. 
Note: node-debug adds this option for you by default. 

此外,检查出config options为每一个(节点调试和节点巡视员)

+0

我会去查的选项,如果有好的我会反馈在这里:) – sayen 2015-04-01 03:09:21

+0

我似乎发现泄漏选项,我在node-debug.js中添加了一个'console.log'来打印execArgs,结果execArgs只是'--debug-brk'。所以我尝试运行'node --debug-brk index.js'附加到检查器,然后我发现调试器不工作,我无法设置断点。运行'node --debug index.js'很好。有点奇怪。 :P – sayen 2015-04-01 03:34:32

+0

无论如何都为他们发布问题[https://github.com/node-inspector/node-inspector/issues/598](https://github.com/node-inspector/node-inspector/issues/598 ) : 一世 – sayen 2015-04-01 03:50:38

相关问题