NOTE
StrongLoop Arc and slc are no longer under active development, and will soon be deprecated. Arc's features are being included in the IBM API Connect Developer Toolkit: Please use it instead.
Skip to end of metadata
Go to start of metadata


Overview

Use Node Inspector (invoked with the slc debug command) to debug Node applications.  Node Inspector enables you to:

  • Set breakpoints (and specify trigger conditions) in code, disable/enable all breakpoints.
  • Step over, step in, step out, and resume code execution.
  • Inspect scopes, variables, and object properties.
  • Display the value of an expression in source code by hovering your mouse over it.
  • Edit variables and object properties.
  • Break on exceptions.

Prerequisite

Make sure you've installed StrongLoop, which installs the slc command-line tool.

Icon

Node Inspector currently works only in the Google Chrome and Opera browsers. If you are using a different browser, reopen the Node Inspector page in one of those browsers.

Starting the debugger

Run your application in debug mode like this:

This command starts Node Inspector and opens the interface at http://localhost:8080/debug?port=5858 in your default browser.

Icon

By default, slc debug suspends program execution at the beginning of the application: you must then resume it in Node Inspector.

The slc debug command provides a number of options.  See slc debug for more information.  For additional configuration information, see the Node Inspector README.

If you don't want to run your application with the slc debug command, then you must use the node --debug-brk command to halt application execution on the first line.  This enables you to set breakpoints, step through the code, and debug the application.

Debugging a running application

To enable debugging on an application that is already running:

  1. Get the PID of the node process, for example: 

     
  2. Send the application the USR1 signal 

Icon

Windows does not support UNIX signals, so you must use a different technique. See the Node Inspector README for details.