adspace


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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Is node js losing popularity?

588


How we can read a file in node js?

568