I am working on express.js in window environment. I have successfully started my project with npm start. Now I need to add debug statement in package.json file to enable debugging.
Like this:
"scripts": {
"start": "DEBUG=fibonacci:* node ./bin/www"
}
After I have edited in package.json and npm start command I am facing error:
Error: Debug is not an internal or external command
Note: I am following Node.js book and in the book it executes successfully.
Setting environment variables in npm scripts is platform specific.
On Windows:
"start": "set DEBUG=fibonacci:*&& mocha --reporter spec"
On Unix / macOS:
"start": "DEBUG=fibonacci:* mocha --reporter spec"
I recommend to use cross-env (npm i -D cross-env), which deals with those differences and works on all platforms:
"start": "cross-env DEBUG=fibonacci:* mocha --reporter spec"
i think you must set DEBUG as a environment variable
set DEBUG=you_application
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