2015-03-31 63 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

相關問題