I am using supervisor to auto-reload my node.js, e.g.
supervisor -w . app.js
However I can't work out how to get supervisor to run the node.js process in debug, e.g. the equivalent to
node --debug app.coffee
Anyone got any ideas?
Open the starting file (typically index. js ), activate the Run and Debug pane, and click the Run and Debug Node. js (F5) button. The debugging screen is similar to Chrome DevTools with a Variables, Watch, Call stack, Loaded scripts, and Breakpoints list.
This also works (and you don't need a separate bash script):
supervisor -- --debug app.js
supervisor -- --debug=7070 app.js
This solution will work for *nix:
Go to /usr/local/bin
or any other directory in your $PATH
$ cd /usr/local/bin
Create an executable script (say, node-debug) with the following contents
#!/bin/bash
node --debug $@
To make it executable:
$ sudo chmod 777 /usr/local/bin/node-debug
Now you can run supervisor like this:
$ supervisor -x node-debug script.js
P.S.: To round it up:
su
echo '#!/bin/bash
node --debug $@' > /usr/local/bin/node-debug
chmod 777 /usr/local/bin/node-debug
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