Recently I have just started studying Node.js and so I’m a still novice in Node.js. Therefore, there are many bugs in my code. That’s why I’d like to write down how to debug Node.js effectively.
First, we need to install Node inspector by using npm. You must familiar with it. This tool is so general to use. It’s better to add -g option to install globally. And you probably have to execute it on sudo. like :
sudo npm install -g node-inspector
That’s it. You can use it now.
How to use
You will get a message like Visit http://127.0.0.1:8080/debug?port=5858 to start debugging. So, follow the instruction and then we can see the debug tool. It’s so helpful to learn Node.js. It teach us how Node.js is executed.