How to debug Nodejs code?

Asked

Viewed 290 times

5

In my initial studies in web development with NODEJS I have the following question: a tool to debug NODEJS codes in a Web system ?

  • 1

    VS Code + Extension does it very well.

  • 1

    could share a step-by-step setting environment ? as well as case study !

  • 1

    Sure. https://codevisualstudio.com/docs/nodejs/nodejs-debugging

  • You can take a look at Microsoft’s Visual Studio IDE, it features a built-in Debugger that allows you to pause execution and test live variables. Following links: Presentation of VS Code https://www.youtube.com/watch?v=119e0lgol0s Download: https://code.visualstudio.com/

  • See in this link how to configure Vscode to use the debug of Nodejs applications. Configure Debug Vscode

2 answers

7


function facaalgumacoisa(a+b) {

        debugger;

        return a+b;

    }

    let test = 0;

    debugger;

in the command line type node inspect nomedoarquivo.js

2

There are some options for you to do this...

I think it’s cool to use vs code with extensions...

If you want to learn about javascript, Node, React and React Native, I recommend you take a look at Rocket Seat: https://skylab.rocketseat.com.br/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.