Skip to content

Commit cd81093

Browse files
author
Max Black
committed
docs(config): clarify .npmrc naming convention for environment variable overrides
1 parent 7da8fdd commit cd81093

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/lib/content/using-npm/config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ For details see [this issue](https://github.com/npm/npm/issues/14528).
3131

3232
Notice that you need to use underscores instead of dashes, so `--allow-same-version` would become `npm_config_allow_same_version=true`.
3333

34+
**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.
35+
3436
#### npmrc Files
3537

3638
The four relevant files are:

0 commit comments

Comments
 (0)