Sunday, 15 December 2019

node js express debugging tutorial

https://stackify.com/node-js-debugging-tips/




You may notice that (unlike before) we’re not passing the—inspect flag. There are two ways to set up your node process with inspect mode, either by passing the flag from within your IDE or through your IDE. So let’s explore the new approach, via your IDE.
Now that your app is running, go to VS Code and open the command palette, either with the view tab or by pressing:
Shift + Cmd + p
Select Attach to Node Process.
VSCode
You should now have another menu (shown below) of the running node processes.
Select the top option to attach the debugger.
VSCode

Now your running node process is accessible for debugging.
Your console should now show:
Debugger listening on ws://127.0.0.1:9229/d5efc834-41ae-4758-a9e6-4d8767c5752a

No comments:

Post a Comment