We can debug an app in nodeJs using Syntax : node-debug app.js
But how can I debug using nodemon
I tried nodemon --debug app.js
but its not working.
please help me how to debug using nodemon
Thanks in advance :)
Asked
Active
Viewed 1,750 times
1

maulik sakhare
- 1,957
- 1
- 12
- 19
-
Which IDE are you using? – Deendayal Garg Mar 28 '16 at 14:31
-
Visual Studio code. I am using Express generator and OS is windows 8.1 – maulik sakhare Mar 29 '16 at 05:10
-
@mauliksakhare have you found the fix? or any alternatives? – Pramesh Bajracharya Dec 13 '17 at 18:42
-
@PrameshBajracharya I was not able to find any way for it. Please let me know if you find any way for it – maulik sakhare Dec 19 '17 at 06:32
-
@mauliksakhare , yea I did find the fix. I was a small bug in nodemon version. Check https://stackoverflow.com/questions/47800466/nodemon-inspect-debug-not-working/47816378#47816378 for more. – Pramesh Bajracharya Dec 20 '17 at 13:47
1 Answers
1
Currently, "--debug" is deprecated, instead use "--inspect".
Simply type: $ nodemon --inspect app.js
You'll see the output like so:
[nodemon] 2.0.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node --inspect server.js`
Debugger listening on ws://127.0.0.1:9229/26849510-cfac-4aae-8dc0-8d9883809ba5
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached...
To open the GUI debugger, open Chrome browser and type in the URL field:
[ chrome://inspect#devices ]
You'll see at the bottom of the opened page:
[ Remote Target
#LOCALHOST
Target (v12.18.3) trace
app.js
file:///[your local path of the app.js ]
inspect
click to inspect you'll see the debugger ... enjoy it ...

anihoyan
- 11
- 4