Debugger

Node.js provides a simple TCP based protocol and built-in debugging client. For debugging your JavaScript file, you can use debug argument followed by the js file name you want to debug.

Syntax:

snippet
node debug [script.js | -e "script" | :]

Example:

snippet
node debug main.js
Node.js debugger example 1

If you make any error:

If you make any error in your js file source code or provide a wrong path on the Node.js command prompt then you will get the following result.

Node.js debugger example 2

In the above example, the path is not specified although the main.js file is located on desktop.

Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents +