+6

How to debug a nodejs application?

Hi! Anybody knows how to debug a Web Server application implemented with NodeJS? Any suggestion for a tool?

11/8/2019 8:07:07 AM

Ludovico Iommi

7 Answers

New Answer

+5

To debug node in the browser, type the following: Chrome://inspect Then click on the open node dedicated server On the command line type the following: Node --inspect filename.js,

+5

Insert one or more statement debugger; into your nodejs code where you want to insert breakpoint, then run cmd: node inspect <your node.js> on debug> prompt, type next for next statement execution, or type cont to continue execution. or type repl command for variable evaluation.

+4

o.gak Nodejs run directly from server, debugging codes cannot be viewed from front-end browser Chrome devtool.

+3

Calviղ Thank you for your explanation.:)

+3

VSCode Will let you debug your Node code in user-friendly way

+3

console.log is very useful for me, try to explore more the console methods

+2

A Chrome debug tool? Open the web page in Chrome and push `ctrl + shift + i`.