From 5a75c16156dd9ca9f4865c78ef484e504da32b80 Mon Sep 17 00:00:00 2001 From: Max Black Date: Wed, 19 Nov 2025 13:55:57 -0800 Subject: [PATCH] docs(config): clarify .npmrc naming for env var overrides --- docs/lib/content/using-npm/config.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/lib/content/using-npm/config.md b/docs/lib/content/using-npm/config.md index 865ca05b92914..c1e117a807e31 100644 --- a/docs/lib/content/using-npm/config.md +++ b/docs/lib/content/using-npm/config.md @@ -31,6 +31,8 @@ For details see [this issue](https://github.com/npm/npm/issues/14528). Notice that you need to use underscores instead of dashes, so `--allow-same-version` would become `npm_config_allow_same_version=true`. +**Important:** When defining custom configuration keys in `.npmrc` files, use hyphens instead of underscores (e.g., `custom-key=value`). This ensures they can be overridden by environment variables, since npm automatically converts underscores to hyphens when reading environment variables. Keys with underscores in `.npmrc` files cannot be overridden via environment variables. + #### npmrc Files The four relevant files are: