If you want to use Node's debugger for TypeScript code, you will have to compile your Node.js app to JavaScript. Chrome DevTools) to unpause the debugging process. This can be done by using the flag -inspect-brk, which sets a break before running your code. When your app has a heavy initialization, you may want to pause your app until the debugger is attached. If you want to continue from a breakpoint (set with the debugger statement), you have to enter cont (continue) within the CLI. dist/app.js (note the missing hyphens!)īe aware that the Node.js inspector supports breakpoints but is not a full-featured debugger. If you want to run debugging entirely in the CLI, you can start your app with: If you want to allow external connections (from the public internet) you have to bind the debugging interface to IP/Host "0.0.0.0". You can point Node.js to a specific IP and Port by running: Make sure that your Node.js process is listening to it. Once your Node.js app is registered as remote target and listening for debuggers, you can open the webpage chrome://inspect/#devices in Google Chrome to see the dedicated DevTools for Node.īy default, the DevTools try to discover targets on "127.0.0.1:9229". This can be done by using the -inspect flag when starting the node process: To inspect your Node.js app with Google Chrome DevTools, you have to make it a remote target. It's called remote debugging and can be started from Google Chrome's internal website. You can use Chrome's DevTools to debug Node.js applications.
0 Comments
Leave a Reply. |