Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debug is not a recognized command (express)

Im running express on windows 8. I ran the command

>express app

after i ran the command to install dependencies

>cd app && npm install

after i attempted to run the app using the given command

>DEBUG=my-application ./bin/www

but I received the error message

'Debug' is not recognized as an internal or external command,
operable program or batch file.

any ideas on how to fix this? Some background info, I successfully installed node.js from their website. I attempted to install express usings the commands

>npm install

when that didnt work i followed the instuctions on this website https://coderwall.com/p/mbov6w. when that didnt work i used the following command and it worked

npm install -g express-generator@3

i also made my own package.json and app.js based off the express website and i am now stuck.

like image 618
B4dmonkey Avatar asked Oct 08 '14 16:10

B4dmonkey


People also ask

How do I enable debugging in Express?

To use this module while running the express app, set the DEBUG environment variable to express:* The output generated on running the command is shown below: These logs help in finding any bug in the program and tell which part of the program is creating the problem.


2 Answers

For Windows : change your start command in the package.json file to

"scripts": {
    "start": "set DEBUG=my-application & node ./bin/www"   
}

then you can run npm start. There's no need to set the DEBUG environment variable in your cmd window first.

like image 156
Bart Avatar answered Sep 22 '22 20:09

Bart


use this settings on your package.json

For window Users..

  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "set DEBUG=app & node app.js"
  },

For Mac Users

  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "DEBUG=app node app.js"
  },

app is your-app-name such as [app.js][server.js] etc.

like image 44
Richard Robert Avatar answered Sep 22 '22 20:09

Richard Robert