3

node-inspectorを使用してノード アプリをデバッグしようとしています。最初に、私は使用します

node-debug index.js

しかし、インスペクターはdebuggerステートメントで停止しません。また、ブレークポイントを設定できません。

しかし、私が実行すると

 node-inspector

次に、デバッグフラグを付けてノードを実行します

 node --debug index.js

検査官は魅力のように機能します。

では、これら2つの違いは何ですか?https://github.com/node-inspector/node-inspector/blob/master/bin/node-debug.jsを読み込もうとしましたが、率直に言って理解できません:O

どうもありがとうございました!

私はMac OSX 10.10.2を使用しています

4

1 に答える 1

1

基本的に、node-debug は node-inspector をロードしますが、いくつかのデフォルト構成も設定します。ドキュメントでこのステートメント
を 参照してください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.

また、それぞれの構成オプション(node-debug および node-inspector) を 確認してください。

于 2015-03-31T15:15:23.040 に答える