js code in using
dev-tools. there is a lot there
to the code and more. But as
nodeJs developer we miss the
for the Debugging like putting breakpoint in the source files.
But, that was the past. Now, our friend
vscode by microsoft is the IDE
that we are seeking to get help with.
There are many ways to debug a node application.
Assume you have a script file
Debugusing node context in the comand line
node debug app.js
This command will put break point and will show us the context
of the code node is running. There are more commands for help.
help in the console. to see the list of commands.
--inspectto run the V8 in the
sh node --inspect app.js node --inspect --debug-brk app.js //will create brk point on the line1.This will give a debug url to like this
To start debugging, open the following URL in Chrome: chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/80bcf82c-fc76-47ad-9514-1edb99940c0a
copy and past this url into the chrome browser and enjoy.