You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
doc: NODE_OPTIONS description is ambiguous/confusing #28910
A space-separated list of command line options. options... are interpreted as if they had been specified on the command line before the actual command line (so they can be overridden). Node.js will exit with an error if an option that is not allowed in the environment is used, such as -p or a script file.
To me that "(so they can be overridden)" part is ambiguous. Do the command line options override the environment NODE_OPTIONS, or vice versa?
I would be happy to make a quick PR myself, but I don't actually know the semantics, so I'm making this quick issue.
Quick demo that the CLI flag overrides NODE_OPTIONS:
$ node --inspect=localhost:5555
Debugger listening on ws://localhost:5555/6b7727a2-c795-451a-b36a-d56ae4edcafb
Debugger listening on ws://localhost:5555/6b7727a2-c795-451a-b36a-d56ae4edcafb
For help, see: https://nodejs.org/en/docs/inspector
Welcome to Node.js v12.7.0.
Type ".help" for more information.
>
$ NODE_OPTIONS='--inspect=localhost:4444' node
Debugger listening on ws://localhost:4444/a80e0061-7300-4ff7-8544-b68d24daa0bd
Debugger listening on ws://localhost:4444/a80e0061-7300-4ff7-8544-b68d24daa0bd
For help, see: https://nodejs.org/en/docs/inspector
Welcome to Node.js v12.7.0.
Type ".help" for more information.
>
$ NODE_OPTIONS='--inspect=localhost:4444' node --inspect=localhost:5555
Debugger listening on ws://localhost:5555/03f8aa25-bf48-4e81-bbeb-b25f52c2c58d
Debugger listening on ws://localhost:5555/03f8aa25-bf48-4e81-bbeb-b25f52c2c58d
For help, see: https://nodejs.org/en/docs/inspector
Welcome to Node.js v12.7.0.
Type ".help" for more information.
>
Activity
Trott commentedon Aug 1, 2019
The CLI flag overrides the NODE_OPTIONS value. PR away!
Trott commentedon Aug 1, 2019
Quick demo that the CLI flag overrides NODE_OPTIONS:
doc: describe NODE_OPTIONS interop w/cmd line opts
doc: describe NODE_OPTIONS interop w/cmd line opts