Config File Locator

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.

  1. Project level

    Project settings

    Files at the workspace root. Replace <workspace> with that directory; a standalone project uses its project root.

    Config file location
    <workspace>/pnpm-workspace.yaml
    General pnpm settings and workspace configuration. This file is also used for standalone projects.
    <workspace>/.npmrc
    npm-compatible registry and authentication settings only; do not put credentials in a committed file.
    Commands
    vi "<workspace>/pnpm-workspace.yaml"
    vi "<workspace>/.npmrc"
  2. User level

    User defaults

    Separate 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
    ~/.config/pnpm/config.yaml
    General settings. pnpm 12.1+ also writes structured login credentials (_auth) here.
    ~/.config/pnpm/rc
    Global npm-compatible registry/authentication settings.
    ~/.config/pnpm/auth.ini
    pnpm 11 writes login tokens here. pnpm 12.1+ continues to read this legacy file.
    ~/.npmrc
    npm-compatible fallback. For INI authentication, workspace .npmrc takes precedence over auth.ini, then this file. npmrcAuthFile can change this fallback path.
    $XDG_CONFIG_HOME/pnpm/config.yaml
    Alternative YAML path when XDG_CONFIG_HOME is set.
    $XDG_CONFIG_HOME/pnpm/rc
    Alternative registry/auth path when XDG_CONFIG_HOME is set.
    $XDG_CONFIG_HOME/pnpm/auth.ini
    Alternative legacy auth path when XDG_CONFIG_HOME is set.
    Commands
    vi "$HOME/.config/pnpm/config.yaml"
    vi "$XDG_CONFIG_HOME/pnpm/config.yaml"
    vi "$HOME/.npmrc"

Inspect configuration
pnpm config list

Official pnpm documentation