Komodo can debug Node programs locally or remotely. The instructions below describe how to configure Komodo and Node for debugging in both scenarios. For general information about using the Komodo debugger, see Komodo Debugger Functions.
Debugger commands can be accessed from the Debug menu, by shortcut keys, or from the Debug Toolbar. For a summary of debugger commands, see the Debugger Command List.
To specify which Node.js interpreter Komodo uses for local debuging and code intelligence:
To start a local Node debugging session:
On the Debug menu or Debug Toolbar, click Go/Continue or Step In to invoke the debugging session. Toggle breakpoints by clicking in the Breakpoint Margin.
See Komodo Debugger Functions for full instructions on using Komodo's debugging functionality.
When debugging a Node program remotely, the program is executed by the debugger on the remote system and the debug output is sent to Komodo over the network using the DBGP protocol. Komodo controls the debugging session (e.g. stepping and breakpoints) once the session starts on the remote system.
To set this up on the remote system, install the komodo-debug package with npm:
npm install komodo-debug -g
This installs the '
node-dbgp' program and supporting libraries. To initiate a remote debugging session:
node-dbgp -h <_komodo-host_> -p <_port_> server.js
Specify the hostname or IP address of the system running Komodo with the '-h' option and the debugger listener port with '-p'. You can check the port Komodo is listening on under Debug|Listener Status. If the DBGP Proxy is used, specify those instead.
On systems where you cannot install komodo-debug globally, you may need to run
node-dbgp with the node interpreter and specify the path to it:
node /path/to/node_modules/node-dbgp ...
|**Note**: For Komodo to open an editable copy of the file, a [Mapped URI](debugger#remote_uri_mapping) must be created to link the file on the remote filesystem with the URI Komodo receives from the remote debugger.|
Breakpoints can be hard-coded in a Node application using the
debugger statement. This will initiate a break at the corresponding line when the application is run with
© 2017 ActiveState Software Inc. All rights reserved. ActiveState®,
Komodo®, ActivePerl®, ActivePython®, and ActiveTcl® are registered
trademarks of ActiveState.
All other marks are property of their respective owners.