HiveBrain v1.2.0
Get Started
← Back to all entries
snippetjavascriptTip

Debugging Node.js using Chrome Developer Tools

Submitted by: @import:30-seconds-of-code··
0
Viewed 0 times
javascriptdevelopertoolsdebuggingnodechromeusing

Problem

Node.js can be debugged using Chrome Developer Tools since v6.3.0. Here's a quick guide on how to do this:
  1. Download and install Node.js v6.3.0 or newer, if you don't already have it installed on your machine.
  2. Run node with the --inspect-brk flag (e.g. node --inspect-brk index.js).
  3. Open about:inspect in a new tab in Chrome. You should see something like the screenshot below.
  4. Click Open dedicated DevTools for Node to open a new window connected to your Node.js instance.

Solution


  1. Run node with the --inspect-brk flag (e.g. node --inspect-brk index.js).
  2. Open about:inspect in a new tab in Chrome. You should see something like the screenshot below.
  3. Click Open dedicated DevTools for Node to open a new window connected to your Node.js instance.
  4. Use the Developer Tools to debug your Node.js application!


!about:inspect page

Context

From 30-seconds-of-code: nodejs-chrome-debugging

Revisions (0)

No revisions yet.