4 ms·
Does anyone have a link to better explanation of the changes to `debugger`? > The legacy command line debugger is being removed in Node.js 8. As a command line
by ianstormtaylor 9y ago
Does anyone have a link to better explanation of the changes to `debugger`?
> The legacy command line debugger is being removed in Node.js 8. As a command line replacement, node-inspect has been integrated directly into the Node.js runtime. Additionally, the V8 Inspector debugger, which arrived previously as an experimental feature in Node.js 6, is being upgraded to a fully supported feature.
It sounds like `node debug` will no longer work? But it is replaced with something that's better? What is `node-inspect` and where can I learn about it?
- rattray 9y agoGood questions – the new facilities are improvements AFAICT: node --inspect index.js Or node --inspect --debug-brk index.js then open `chrome://inspect` in Chrome. https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27 https://medium.com/@paul_irish/debugging-node-js-nightlies-w...
- sigil 9y agoCan I debug node 8 from the command line, or do I need X / chrome now?
- rattray 9y agoYou can also debug, to a limited degree, from the command line: https://nodejs.org/api/debugger.html https://nodejs.org/api/debugger.html > Node.js's debugger client is not a full-featured debugger, but simple step and inspection are possible.
- sigil 9y agoThanks. I use the REPL debugger often, glad to see it's not going away.
- NoInkling 9y agoNote: --debug-brk has been deprecated in Node 8, you can use --inspect-brk (--inspect not needed) instead.
- NoInkling 9y agohttps://github.com/nodejs/node-inspect https://github.com/nodejs/node-inspect It's explained there. Basically, `node debug` will still work, they just had to change the command line debugger to support the new protocol, since the old protocol was removed from V8. But unless you really need to debug from the command line, --inspect/--inspect-brk is the way to go. You don't necessarily have to use Chrome either, these days IDE debuggers support this protocol as well.