pnpm config file locations
Find pnpm project and user configuration file locations on macOS, Linux, and Windows.
This page covers pnpm 12 configuration. Project settings override user defaults for the same setting, but YAML settings and npm-compatible registry/auth files serve different purposes. General settings belong in pnpm-workspace.yaml or config.yaml; .npmrc is not a general pnpm settings file as it was in older versions. Command-line options and environment variables can also override settings. The config directory is user-specific even though pnpm calls it global.
Project level
Project settingsFiles at the workspace root. Replace <workspace> with that directory; a standalone project uses its project root.
Config file location
General pnpm settings and workspace configuration. This file is also used for standalone projects.<workspace>/pnpm-workspace.yamlnpm-compatible registry and authentication settings only; do not put credentials in a committed file.<workspace>/.npmrcCommands
vi "<workspace>/pnpm-workspace.yaml"vi "<workspace>/.npmrc"User level
User defaultsSeparate files for general settings and registry/authentication. A non-empty XDG_CONFIG_HOME replaces the default pnpm config directory. The commands edit the default YAML file, the XDG YAML alternative (only when set), and the npm fallback respectively.
Config file location
General settings. pnpm 12.1+ also writes structured login credentials (_auth) here.~/.config/pnpm/config.yamlGlobal npm-compatible registry/authentication settings.~/.config/pnpm/rcpnpm 11 writes login tokens here. pnpm 12.1+ continues to read this legacy file.~/.config/pnpm/auth.ininpm-compatible fallback. For INI authentication, workspace .npmrc takes precedence over auth.ini, then this file. npmrcAuthFile can change this fallback path.~/.npmrcAlternative YAML path when XDG_CONFIG_HOME is set.$XDG_CONFIG_HOME/pnpm/config.yamlAlternative registry/auth path when XDG_CONFIG_HOME is set.$XDG_CONFIG_HOME/pnpm/rcAlternative legacy auth path when XDG_CONFIG_HOME is set.$XDG_CONFIG_HOME/pnpm/auth.iniCommands
vi "$HOME/.config/pnpm/config.yaml"vi "$XDG_CONFIG_HOME/pnpm/config.yaml"vi "$HOME/.npmrc"
Inspect configuration
pnpm config listOfficial pnpm documentation