Files
pnpm/auth/commands/CHANGELOG.md
2026-04-21 00:17:38 +02:00

7.0 KiB

@pnpm/auth.commands

1100.0.3

Patch Changes

  • Updated dependencies [7d25bc1]
  • Updated dependencies [9e0833c]
    • @pnpm/config.reader@1101.1.0

1100.0.2

Patch Changes

  • Updated dependencies [cee550a]
  • Updated dependencies [4ab3d9b]
  • Updated dependencies [9af708a]
  • Updated dependencies [ea2a7fb]
  • Updated dependencies [ff7733c]
    • @pnpm/cli.utils@1101.0.0
    • @pnpm/config.reader@1101.0.0

1100.0.1

Patch Changes

  • Internally, @pnpm/network.web-auth's promptBrowserOpen now uses the open package instead of spawning platform-specific commands. The execFile field and PromptBrowserOpenExecFile / PromptBrowserOpenProcess type exports have been removed from PromptBrowserOpenContext.
  • Updated dependencies
    • @pnpm/network.web-auth@1101.0.0
    • @pnpm/cli.utils@1100.0.1
    • @pnpm/config.reader@1100.0.1
    • @pnpm/network.fetch@1100.0.1

1000.1.0

Minor Changes

  • de3dc74: During web-based authentication (pnpm login, pnpm publish), users can now press ENTER to open the authentication URL in their default browser. The background polling continues uninterrupted, so users who prefer to authenticate on their phone can still do so without pressing anything.

  • d4a1d73: Added pnpm login command for authenticating with npm registries. Supports web-based login (with QR code) and classic username/password login as a fallback. The adduser command is aliased to login.

  • 16cfde6: Added pnpm logout command for logging out of npm registries. Revokes the authentication token on the registry and removes it from the local configuration.

  • 2df8b71: pnpm no longer reads all settings from .npmrc. Only auth and registry settings are read from .npmrc files. All other settings (like hoist-pattern, node-linker, shamefully-hoist, etc.) must be configured in pnpm-workspace.yaml or the global ~/.config/pnpm/config.yaml.

    What changed

    .npmrc is now only for auth and registry settings. pnpm-specific settings in .npmrc are ignored. Move them to pnpm-workspace.yaml.

    pnpm no longer reads npm_config_* environment variables. Use pnpm_config_* environment variables instead (e.g., pnpm_config_registry instead of npm_config_registry).

    pnpm no longer reads the npm global config at $PREFIX/etc/npmrc.

    pnpm login writes auth tokens to ~/.config/pnpm/auth.ini.

    Settings still read from .npmrc

    The following settings continue to be read from .npmrc files (project-level and ~/.npmrc):

    • registry and @scope:registry — registry URLs
    • //registry.example.com/:_authToken — auth tokens per registry
    • _auth, _authToken, _password, username, email — global auth credentials
    • //registry.example.com/:tokenHelper — token helper commands
    • ca, cafile, cert, key, certfile, keyfile — SSL certificates
    • strict-ssl — SSL verification
    • proxy, https-proxy, no-proxy — proxy settings
    • local-address — local network address binding
    • git-shallow-hosts — git shallow clone hosts

    New npmrcAuthFile setting

    A new npmrcAuthFile setting can be added to pnpm-workspace.yaml or ~/.config/pnpm/config.yaml to specify a custom path to the user .npmrc file (defaults to ~/.npmrc):

    npmrcAuthFile: /custom/path/.npmrc
    

    New registries setting in pnpm-workspace.yaml

    Registry URLs can now be configured in pnpm-workspace.yaml, so there's no need to commit .npmrc files with registry mappings:

    registries:
      default: https://registry.npmjs.org/
      "@my-org": https://private.example.com/
      "@internal": https://nexus.corp.com/
    

    This replaces the .npmrc settings registry=... and @scope:registry=....

    Auth file read order (highest priority first)

    1. ~/.config/pnpm/auth.ini — pnpm's own auth file (written by pnpm login)
    2. <workspace>/.npmrc — workspace root (or project root)
    3. ~/.npmrc (or custom npmrcAuthFile) — user-level fallback

    Note: .npmrc is only read from the workspace root, not from individual package directories.

    Migration guide

    1. Move pnpm settings from .npmrc to pnpm-workspace.yaml:

      Before (.npmrc):

      shamefully-hoist=true
      node-linker=hoisted
      

      After (pnpm-workspace.yaml):

      shamefullyHoist: true
      nodeLinker: hoisted
      
    2. Move scoped registry mappings from .npmrc to pnpm-workspace.yaml:

      Before (.npmrc):

      @my-org:registry=https://private.example.com
      

      After (pnpm-workspace.yaml):

      registries:
        "@my-org": https://private.example.com/
      
    3. If you use npm_config_* env vars, switch to pnpm_config_*:

      # Before
      npm_config_registry=https://registry.example.com
      
      # After
      pnpm_config_registry=https://registry.example.com
      
    4. Auth tokens in ~/.npmrc still work. No migration needed for registry authentication — pnpm continues to read ~/.npmrc as a fallback.

Patch Changes