Skip to content

cli: fix env vars missing from node --help#63893

Open
watilde wants to merge 1 commit into
nodejs:mainfrom
watilde:cli-improve
Open

cli: fix env vars missing from node --help#63893
watilde wants to merge 1 commit into
nodejs:mainfrom
watilde:cli-improve

Conversation

@watilde

@watilde watilde commented Jun 13, 2026

Copy link
Copy Markdown
Member

The envVars table in print_help.js was built with a malformed expression that silently dropped entries from the help output:

  1. The closing parenthesis of ArrayPrototypeConcat() was placed after the hasIntl argument, so the hasNodeOptions and hasCrypto lists were passed as extra arguments to new SafeMap(), which ignores everything after the first. As a result NODE_OPTIONS, OPENSSL_CONF, SSL_CERT_DIR and SSL_CERT_FILE never appeared.

  2. The NODE_ICU_DATA helpText used '...' + hasSmallICU ? '' : '...', which parses as ('...' + hasSmallICU) ? '' : '...' and is always the empty string. Since format() skips entries with falsy helpText, the NODE_ICU_DATA entry was dropped as well.

The existing test only checked for the bare NODE_ICU_DATA and OPENSSL_CONF substrings, which also occur in the --icu-data-dir and --openssl-config descriptions, so the missing entries went unnoticed. The added test parses the "Environment variables:" section and asserts each entry appears at the start of a line.

The `envVars` table in print_help.js was built with a malformed
expression that silently dropped entries from the help output:

1. The closing parenthesis of `ArrayPrototypeConcat()` was placed
   after the `hasIntl` argument, so the `hasNodeOptions` and
   `hasCrypto` lists were passed as extra arguments to `new SafeMap()`,
   which ignores everything after the first. As a result NODE_OPTIONS,
   OPENSSL_CONF, SSL_CERT_DIR and SSL_CERT_FILE never appeared.

2. The NODE_ICU_DATA helpText used `'...' + hasSmallICU ? '' : '...'`,
   which parses as `('...' + hasSmallICU) ? '' : '...'` and is always
   the empty string. Since format() skips entries with falsy helpText,
   the NODE_ICU_DATA entry was dropped as well.

The existing test only checked for the bare `NODE_ICU_DATA` and
`OPENSSL_CONF` substrings, which also occur in the `--icu-data-dir`
and `--openssl-config` descriptions, so the missing entries went
unnoticed. The added test parses the "Environment variables:" section
and asserts each entry appears at the start of a line.

Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants