1 – Open your project in Visual Studio Code.
2 – Open the file which your want to debug, in this article we are using our Node API sample present on Github also to learn it. So open index.js file
Now put breakpoints on lines of code which you want to debug, now run the Node project using command npm start
So after doing npm start, if you see the app is running now, we will then to the URL http://localhost:8080/character?name=Tom
You should see the execution being stopped at our breakpoint as below:
So that’s how we debug the application.
While running the app you may face different issues, for example:
– How to know from where the error is coming
– Package.json file missing
– Not running the project from correct location/path
– Package/module not found.