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
#57165 added the NODE_USE_ENV_PROXY environment variable, but the problem with such a variable is that it can not be controlled by the script itself via hashbang without writing into process.env which is dirty and not guaranteed to work depending on the implementation.
Therefor I suggest to also support it as a CLI flag --use-env-proxy and via NODE_OPTIONS=--use-env-proxy, enabling such hashbangs:
#!/usr/bin/env -S node --use-env-proxy
As for precedence, I suggest taking the value of NODE_USE_ENV_PROXY first if present, then fall back to --use-env-proxy.
As for precedence, I suggest taking the value of NODE_USE_ENV_PROXY first if present, then fall back to --use-env-proxy.
For consistency, we should probably go with the other way around - this is what we do for several options like NODE_PENDING_DEPRECATION/--pending-deprecation, NODE_PRESERVE_SYMLINKS/--preserve-symlinks etc.
Activity
joyeecheung commentedon Jul 21, 2025
For consistency, we should probably go with the other way around - this is what we do for several options like
NODE_PENDING_DEPRECATION/--pending-deprecation,NODE_PRESERVE_SYMLINKS/--preserve-symlinksetc.silverwind commentedon Jul 22, 2025
Right, stick to existing precedence.
cli: add --use-env-proxy
cli: add --use-env-proxy
cli: add --use-env-proxy