- Oct 02, 2018
- admin
- 0
Node Inspector:
Debugging a Node.js file can also be done using Node inspector which is a GUI based debugger which is needed to be installed separately using npm.
Steps to use Node Inspector in Node.js:
- Type the command npm install -g node-inspector in the command prompt, in order to install Node Inspector using NPM in the global mode.
- Type the command node-inspector in the command prompt, in order to run Node Inspector.
- A URL is displayed in the command prompt.
- Type the command node-inspector –web-port=port_no in the command prompt, in order to, start the node inspector on a different port, if the default port is unavailable.
- Open the browser and enter the URL.
- Type the command node –debug-brk filename.js in another command prompt.
- Refresh the browser and start debugging.