" node-debug index.js"有什么区别?和"运行node-inspector,然后运行node -debug index.js"

时间:2015-03-31 14:36:17

标签: node.js node-inspector node-debugger

我尝试使用 node-inspector 来调试我的节点应用。首先,我使用

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 个答案:

答案 0 :(得分:1)

基本上,node-debug加载了节点检查器,但也设置了一些默认配置 请参阅文档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.

中的this statement

它预装的完整清单有点难以弄清楚(我不知道任何真正的差异列表)。但如果你真的通过文档,你可以得到一个想法 node-debug

>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(node-debug和node-inspector)