“node-debug index.js”和“run node-inspector,then node –debug index.js”有什么区别?
我尝试使用节点检查器来debugging我的节点应用程序。 起初,我用
node-debug index.js
但检查员不会停止在debugger
语句,也无法设置断点。
但是,如果我跑
node-inspector
然后用debugging标志运行节点
node --debug index.js
检查员的工作就像一个魅力。
那么这两者有什么区别呢? 我尝试阅读https://github.com/node-inspector/node-inspector/blob/master/bin/node-debug.js但坦率地不明白:O
非常感谢你!
我使用的是mac osx 10.10.2
基本上,节点debugging加载节点检查器,但也设置一些默认configuration。
在文档中查看这个语句 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.
它预先加载的完整清单是很难弄清楚的(我不知道任何真正的差异列表)。 但是,如果你真的通过文档,你可以得到一个想法。
节点debugging
>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.
另外,请查看每个configuration选项 (node-debug和node-inspector)