0

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?

1
  • 1
    In first one you pass --debug=6776 as an argument to your script Commented Jun 9, 2016 at 6:10

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

thanks, I understand now, but I can find link to the docs that shows that

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.