A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27 below:

Debugging Node.js with Chrome DevTools | by Paul Irish

Debugging Node.js with Chrome DevTools 2 min read

·

Jun 24, 2016

Support for Node.js debuggability landed in Node.js in 2016. Here’s how to get up and running. (Post updated Jan 2018)

1. Download and install the current version of node. (v6.3.0+ required)

2. Run node with the --inspect-brk flag:

# Break on the first statement of the scriptnode --inspect-brk index.js

Next, you used to open the big chrome-devtools:// URL it spits out, but don’t. Now there’s a better way…

3. Open about:inspect in Chrome

It’ll redirect you to chrome://inspect quickly and you’ll see something like:

chrome://inspect screenshot

4. Click the Open dedicated DevTools for Node link.

You’ll get a popup window for debugging your node session.

But better than that, when you kill and restart node, the window will automatically reconnect to it. 🔁🔁💥

(Btw: the inspect link beneath the specific target will only apply for that session of node and won’t reconnect.)

Press enter or click to view image in full size

In DevTools, now connected to Node, you’ll have all the Chrome DevTools features you’re used to:

To see this in action, here’s my demo during the 2017 Node Summit:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4