Max Koretskyi
Max Koretskyi

Reputation: 105499

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?

Upvotes: 0

Views: 2523

Answers (1)

Andy Ray
Andy Ray

Reputation: 32066

This is explained in man node.

 SYNOPSIS
        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

Upvotes: 2

Related Questions