Maximus Maximus - 4 months ago 6x
Node.js Question

Run node.js with --debug argument

When I run node like this:

node some.js --debug=6776

Debugger is not started, however if I run it like that:

node --debug=6776 some.js
debugger listening on port 6776

Debugger is started. Why so? Is the order of arguments important?


This is explained in man node.

        node [ -v ] [ --debug | --debug-brk ] [ --v8-options ]
             [ -e command | script.js ] [ arguments ]

node some.js --debug=6776 means run some.js (with node) with the argument --debug=6776

node --debug=6776 some.js means run node with the two arguments --debug=6776 and some.js