How to debug the Node.js code using Node Inspector?



How to debug the Node.js code using Node Inspector?..

Answer / Amit Rajdeo Singh

To debug Node.js code with Node Inspector, follow these steps:
1. Install Node Inspector globally using `npm install -g node-inspector`. Alternatively, you can use Chrome DevTools for debugging.
2. Start the Node application with debugging option: `node --debug app.js`
3. Start Node Inspector: `node-inspector &` or in newer versions of Node.js, `DEBUG=* node app.js`
4. Connect to Node Inspector using Chrome DevTools by navigating to `chrome://inspect`.
5. In the Inspect section, select the Node application and start debugging.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Node.js Interview Questions

What is event loop?

1 Answers  


Which is better node js or python?

1 Answers  


What is the use of setinterval() function in node.js?

1 Answers  


Explain 'Event Emitter' in Node.JS?

1 Answers  


What is template engine?

1 Answers  


Is it free to use node.js?

1 Answers  


can you explain what is globals in nodejs

1 Answers  


Explain ecmascript?

1 Answers  


Why do we use npm?

1 Answers  


How to run node js web application?

1 Answers  


What is the advantage of using node.js?

1 Answers  


How will you import external libraries in Node.js?

1 Answers  


Categories