Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Node's debug module (Windows)?

I am trying to figure out what is wrong with my sessions (using express-session), and I found that it uses the debug module. However, I can't seem to enable the debug messages. It says, debugging needs to be enabled through the DEBUG environment variable, but I can't seem to get it to run.

The tutorial in the README has this picture:

enter image description here

Under Windows I get "DEBUG is not a command for the command-line".

So I tried setting the environment variable explicitly using:

process.env.DEBUG = "*";

and still nothing.

What am I doing wrong?

like image 278
Domi Avatar asked May 01 '14 13:05

Domi


People also ask

How do I debug chrome node?

Using Google Chrome DevTools to Debug To start debugging, let's run our application with the --inspect-brk flag. The next step is to head to Chrome, open a new tab, and enter the URL chrome://inspect/ . Click on “Open dedicated DevTools for Node” to start debugging the application.


1 Answers

As Traveling Tech Guy suggested in the comment, in a Windows command prompt, the proper syntax is:

set DEBUG=* & npm start

Obviously you can replace npm start with whatever command you need to launch your Node.js app. Just be sure to use the set command and don't forget the & between that command and the one launching your Node.js app!

like image 55
T Blank Avatar answered Sep 18 '22 18:09

T Blank