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:
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?
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.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With