Files
pnpm/config/reader
Zoltan Kochan e9e876c3fb fix(config): honor NPM_CONFIG_USERCONFIG as a low-priority fallback (#11545)
* fix(config): honor NPM_CONFIG_USERCONFIG as a low-priority fallback

Restores compatibility with environments that point npm at a custom
.npmrc via NPM_CONFIG_USERCONFIG (e.g. actions/setup-node writing to
${runner.temp}/.npmrc), which silently broke after the v11 env var
prefix change. PNPM-prefixed env vars and npmrcAuthFile from the
global config.yaml continue to take precedence.

Closes #11539

* fix(config): treat empty NPM_CONFIG_USERCONFIG as unset

`??` accepts an empty string as a defined value, so an exported but
unset NPM_CONFIG_USERCONFIG would short-circuit the fallback chain and
make normalizePath('') resolve to process.cwd(). Mirror readEnvVar's
empty-string-to-undefined coercion via a readNpmEnvVar helper so the
fallback to ~/.npmrc works as expected.
2026-05-09 01:48:59 +02:00
..
2026-05-07 00:17:39 +02:00
2026-05-07 00:17:39 +02:00

@pnpm/config.reader

Gets configuration options for pnpm

npm version

Installation

pnpm add @pnpm/config.reader

Usage

import { getConfig } from '@pnpm/config.reader'

getConfig().then(pnpmConfig => console.log(pnpmConfig))

License

MIT