Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug Node com Chrome Developer Tools #6

Open
cristofersousa opened this issue Sep 18, 2016 · 0 comments
Open

Debug Node com Chrome Developer Tools #6

cristofersousa opened this issue Sep 18, 2016 · 0 comments

Comments

@cristofersousa
Copy link
Contributor

cristofersousa commented Sep 18, 2016

Debugging Node.js with Chrome DevTools

by Paul Irish

New support for Node.js debuggability landed in Node.js master in May. You can see it in action in the DevTools Google I/O talk. Or you can try it out yourself, right now. Let’s go…

Here’s how to get up and running:

* 1. Download* and install the current version of node.**

2. A nightly build was previously required, but support is innode as of v6.3.0.

You can install manually, use nvm to install the latest: nvm install node,** or even use **node-nightly** to get a fresh nightly build.

3. Run it with the --inspect flag

node --inspect index.js

You can also break on the first statement of the script with --debug-brk.

node --inspect --debug-brk index.js

4. Open the provided URL
You’ll get a url starting with “chrome-devtools://..” to copy/paste into Chrome. After dropping it in, you’ll have all the Chrome DevTools features you’re used to:

  • Complete breakpoint debugging, stepping w/ blackboxing
  • Source maps for transpiled code
  • LiveEdit: JavaScript hot-swap evaluation w/ V8
  • Console evaluation with ES6 feature/object support and custom object formatting
  • Sampling JavaScript profiler w/ flamechart
  • Heap snapshot inspection, heap allocation timeline, allocation profiling
  • Asynchronous stacks for native promises

Enjoy.

More info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant