Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: NODE_OPTIONS description is ambiguous/confusing #28910

Closed
reasonablytall opened this issue Jul 31, 2019 · 2 comments
Closed

doc: NODE_OPTIONS description is ambiguous/confusing #28910

reasonablytall opened this issue Jul 31, 2019 · 2 comments

Comments

@reasonablytall
Copy link
Contributor

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.

https://nodejs.org/api/cli.html#cli_node_options_options

@Trott
Copy link
Member

Trott commented Aug 1, 2019

The CLI flag overrides the NODE_OPTIONS value. PR away!

@Trott
Copy link
Member

Trott commented Aug 1, 2019

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.
> 

reasonablytall added a commit to reasonablytall/node that referenced this issue Aug 2, 2019
@Trott Trott closed this as completed in 5eaef7b Aug 4, 2019
BridgeAR pushed a commit that referenced this issue Aug 6, 2019
Fixes #28910

PR-URL: #28928
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Roman Reiss <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants