Config File Locator

pnpm config file locations


Commands use a POSIX shell (macOS, Linux, or WSL). Install the named editor or CLI first. Before using an environment-variable path, check that the variable is set to a non-empty, intended path. When using vi or Notepad, ensure the parent directory exists and is writable. A missing file is created when you save it; Notepad may ask to create it.

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. Run commands from the workspace root; 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 "./pnpm-workspace.yaml"
    vi "./.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