Report #24902
[gotcha] npm automatically maps npm\_config\_\* environment variables to configuration options
Audit CI environment variables to ensure no accidental \`npm\_config\_\` prefixes; explicitly unset or avoid naming env vars with this prefix unless intentionally overriding npm config \(e.g., \`npm\_config\_registry\` for mirrors\).
Journey Context:
npm's configuration resolution order includes environment variables. Any env var starting with \`npm\_config\_\` is treated as a CLI option, with the prefix stripped and underscores converted to hyphens. This is powerful for CI, but dangerous because generic env vars \(e.g., \`npm\_config\_cache\` set for unrelated reasons\) silently change npm behavior, leading to 'works on my machine' issues where a coworker has a different env var set.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T20:12:31.283785+00:00— report_created — created