Fetching contributors…
Cannot retrieve contributors at this time
100 lines (57 sloc) 3.01 KB

Node Inspector is a debugger interface for nodeJS using the WebKit Web Inspector.

Getting Started


  • nodeJS
    • versions: 0.3.0 or later
  • npm
  • A WebKit based browser: Chrome, Safari, etc.
  • Optional v8-profiler to use the profiles panel


  • With npm

      npm install -g node-inspector


As an example lets debug test/hello.js, from the root project directory (node-inspector)

  1. start the inspector in the background

     node-inspector &
  2. start the node instance to debug. Use --debug-brk to pause the script on the first line

     node --debug test/hello.js
  3. open in your favorite WebKit based browser

    Chrome 5 users MUST use NOT localhost or the browser will not connect to the debugger

  4. you should now see the javascript source from nodeJS

  5. select the hello.js script and set some breakpoints (far left line numbers)

  6. now open in a new tab then go back to inspector tab

  7. click "Step over next function call" and observe changes in the RHS panel

  8. then watch the screencasts

For more information on getting started see the wiki


	--web-port=[port]     port to host the inspector (default 8080)

Cool stuff

  • the WebKit Web Inspector debugger is a great js debugger interface, it works just as well for node
  • uses WebSockets, so no polling for breaks
  • remote debugging
  • javascript top to bottom :)
  • edit running code

Known Issues

This is beta quality code, so use at your own risk:

  • be careful about viewing the contents of Buffer objects, each byte is displayed as an individual array element, for anything but tiny Buffers this will take too long to render
  • while not stopped at a breakpoint the console doesn't always behave as you might expect
  • closing the browser does not stop debugging, you must stop node-inspector manually


To use the profiles panel, install the v8-profiler module:

	npm install v8-profiler

To use it do something like:

	var profiler = require('v8-profiler');

Then view the profiling results with the profiles panel in node-inspector. You can also take heap snapshots on demand from the profiles panel.


This project respectfully uses code from and thanks the authors of: