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?
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?
This solution will work for *nix:
Go to
/usr/local/bin
or any other directory in your $PATHCreate an executable script (say, node-debug) with the following contents
To make it executable:
Now you can run supervisor like this:
P.S.: To round it up:
This also works (and you don't need a separate bash script):
Use the
-x
flag as documented on thenode-supervisor
github pagesupervisor -w . -x 'node --debug' app.js
but that won't work with coffeescript so you have to use
supervisor -w . -x 'coffee --debug' app.js
From the CoffeeScript site :
I tried this and it worked:
supervisor -- --nodejs --debug app.coffee
You can add other arguments like this:
supervisor -w . -n error -- --nodejs --debug app.coffee
node-devnode-dev on Github
Create a "test.js" node.js script in $HOME/nodetest
First terminal (run node in debug mode, debug will listen on the port 5858, node-dev will reload changed files):
Second terminal (start web inspector for a WebKit based browser, inspector connects to the port 5858 of the debugger and listens on the port 8080):
Open this URL in a WebKit based browser (Chrome, Safari, etc.):
Click on "Scripts" and set breakpoints in your code.