How to use node-inspector with `npm start` for my application?
You may want to add a seperate debug
script to package.json
. That way you won't have to remember to revert npm start
when you're finished debugging.
"scripts": { "start": "node ./bin/www", "debug": "node --debug ./bin/www"}
Start with npm run
:
$ npm run debug
In package.json
modify the start
run command:
"scripts": { "start": "node --debug app.js"}
I use it like this, I also set a variable and run the inspector in one command:npm run debug
"scripts": { "start": "set SOAPAPI=https://example.com/&&nodemon", "debug": "start node-inspector --web-port=8081&&set SOAPAPI=https://example.com/&&nodemon --debug"}
*nodemon is an utility wrapper for node, you can use node
instead