Ana içeriğe atla
Sürüm: 6.x


pnpm gets its configuration from the command line, environment variables, and .npmrc files.

The pnpm config command can be used to update and edit the contents of the user and global .npmrc files.

The four relevant files are:

  • per-project configuration file (/path/to/my/project/.npmrc)
  • per-workspace configuration file (the directory that contains the pnpm-workspace.yaml file)
  • per-user configuration file (~/.npmrc)
  • global configuration file (/etc/npmrc)

All .npmrc files are an INI-formatted list of key = value parameters.

Dependency Hoisting Settings


Sürüm 4.0.0 ve sonrasında geçerli

  • Default: true
  • Type: boolean

When true, all dependencies are hoisted to node_modules/.pnpm. This makes unlisted dependencies accessible to all packages inside node_modules.


Sürüm 4.0.0 ve sonrasında geçerli

  • Default: ['*']
  • Type: string[]

Tells pnpm which packages should be hoisted to node_modules/.pnpm. By default, all packages are hoisted - however, if you know that only some flawed packages have phantom dependencies, you can use this option to exclusively hoist the phantom dependencies (recommended).




Sürüm 5.2.0 ve sonrasında geçerli

  • Default: ['*types*', '*eslint*', '@prettier/plugin-*', '*prettier-plugin-*']
  • Type: string[]

Unlike hoist-pattern, which hoists dependencies to a hidden modules directory inside the virtual store, public-hoist-pattern hoists dependencies matching the pattern to the root modules directory. Hoisting to the root modules directory means that application code will have access to phantom dependencies, even if they modify the resolution strategy improperly.

This setting is useful when dealing with some flawed pluggable tools that don't resolve dependencies properly.



Note: Setting shamefully-hoist to true is the same as setting public-hoist-pattern to *.


Sürüm 4.0.0 ve sonrasında geçerli (1.34.0 sürümünde shamefully-flatten olarak eklendi)

  • Varsayılan: false
  • Tip: Boolean

By default, pnpm creates a semistrict node_modules, meaning dependencies have access to undeclared dependencies but modules outside of node_modules do not. With this layout, most of the packages in the ecosystem work with no issues. However, if some tooling only works when the hoisted dependencies are in the root of node_modules, you can set this to true to hoist them for you.

Node-Modules Ayarları


Sürüm 4.2.0 ve sonrasında geçerli (eski adı store)

  • Default: ~/.pnpm-store
  • Type: path

The location where all the packages are saved on the disk.

The store should be always on the same disk on which installation is happening, so there will be one store per disk. If there is a home directory on the current disk, then the store is created in <home dir>/.pnpm-store. If there is no home on the disk, then the store is created at the root of the filesystem. For example, if installation is happening on a filesystem mounted at /mnt, then the store will be created at /mnt/.pnpm-store. The same goes for Windows systems.

It is possible to set a store from a different disk but in that case pnpm will copy packages from the store instead of hard-linking them, as hard links are only possible on the same filesystem.


Sürüm 4.14.0 ve sonrasında geçerli

  • Default: node_modules
  • Type: path

The directory in which dependencies will be installed (instead of node_modules).


Sürüm 5.9.0 ve sonrasında geçerli

  • Default: isolated
  • Type: isolated, hoisted, pnp

Defines what linker should be used for installing Node packages.

  • isolated - dependencies are symlinked from a virtual store at node_modules/.pnpm.
  • hoisted - a flat node_modules without symlinks is created. Same as the node_modules created by npm or Yarn Classic. Legitimate reasons to use this setting:
    1. Your tooling doesn't work well with symlinks. A React Native project will most probably only work if you use a hoisted node_modules.
    2. Your project is deployed to a serverless hosting provider. Some serverless providers (for instance, AWS Lambda) don't support symlinks. An alternative solution for this problem is to bundle your application before deployment.
    3. If you want to publish your package with "bundledDependencies".
    4. If you are running Node.js with the --preserve-symlinks flag.
  • pnp - no node_modules. Plug'n'Play is an innovative strategy for Node that is used by Yarn Berry. It is recommended to also set symlink setting to false when using pnp as your linker.

Sürüm 5.9.0 ve sonrasında geçerli

  • Default: true
  • Tip: Boolean

When symlink is set to false, pnpm creates a virtual store directory without any symlinks. It is a useful setting together with node-linker=pnp.


Sürüm 5.15.0 ve sonrasında geçerli

  • Default: true
  • Tip: Boolean

When false, pnpm will not write any files to the modules directory (node_modules). This is useful for when the modules directory is mounted with filesystem in userspace (FUSE). There is an experimental CLI that allows you to mount a modules directory with FUSE: @pnpm/mount-modules.


Sürüm 4.1.0 ve sonrasında geçerli

  • Default: node_modules/.pnpm
  • Types: path

The directory with links to the store. All direct and indirect dependencies of the project are linked into this directory.

This is a useful setting that can solve issues with long paths on Windows. If you have some dependencies with very long paths, you can select a virtual store in the root of your drive (for instance C:\my-project-store).

Or you can set the virtual store to .pnpm and add it to .gitignore. This will make stacktraces cleaner as paths to dependencies will be one directory higher.

NOTE: the virtual store cannot be shared between several projects. Every project should have its own virtual store (except for in workspaces where the root is shared).


Sürüm 1.25.0 ve sonrasında geçerli

  • Varsayılan: auto
  • Type: auto, hardlink, copy, clone

Controls the way packages are imported from the store.

  • auto - try to clone packages from the store. If cloning is not supported then hardlink packages from the store. If neither cloning nor linking is possible, fall back to copying
  • hardlink - hard link packages from the store
  • copy - copy packages from the store
  • clone - clone (AKA copy-on-write or reference link) packages from the store


Sürüm 6.0.0 ve sonrasında geçerli

  • Default: 10080 (7 days in minutes)
  • Type: number

The time in minutes after which orphan packages from the modules directory should be removed. pnpm keeps a cache of packages in the modules directory. This boosts installation speed when switching branches or downgrading dependencies.

Lock Dosyasının Ayarları


Sürüm 1.32.0 ve sonrasında geçerli (eski adı shrinkwrap)

  • Default: true
  • Tip: Boolean

When set to false, pnpm won't read or generate a pnpm-lock.yaml file.


Sürüm 1.37.1 ve sonrasında geçerli (eski adı prefer-frozen-shrinkwrap)

  • Default: true (from v1.38.0)
  • Tip: Boolean

When set to true and the available pnpm-lock.yaml satisfies the package.json dependencies directive, a headless installation is performed. A headless installation skips all dependency resolution as it does not need to modify the lockfile.

Registry & Authentication Settings


The base URL of the npm package registry (trailing slash included).


The npm registry that should be used for packages of the specified scope. For example, setting @babel:registry= will enforce that when you use pnpm add @babel/core, or any @babel scoped package, the package will be fetched from instead of the default registry.


Define the authentication bearer token to use when accessing the specified registry. For example:


You may also use an environment variable. For example:



Added in: v6.25.0

A token helper is an executable which outputs an auth token. This can be used in situations where the authToken is not a constant value but is something that refreshes regularly, where a script or other tool can use an existing refresh token to obtain a new access token.

The configuration for the path to the helper must be an absolute path, with no arguments. In order to be secure, it is only permitted to set this value in the user .npmrc. Otherwise a project could place a value in a project's local .npmrc and run arbitrary executables.

Setting a token helper for the default registry:


Setting a token helper for the specified registry:


Request Settings


  • Default: The npm CA certificate
  • Type: String, Array or null

The Certificate Authority signing certificate that is trusted for SSL connections to the registry. Values should be in PEM format (AKA "Base-64 encoded X.509 (.CER)"). For example:


Set to null to only allow known registrars, or to a specific CA cert to trust only that specific signing authority.

Multiple CAs can be trusted by specifying an array of certificates:


See also the strict-ssl config.


  • Varsayılan: null
  • Type: path

A path to a file containing one or multiple Certificate Authority signing certificates. Similar to the ca setting, but allows for multiple CAs, as well as for the CA information to be stored in a file instead of being specified via CLI.


  • Varsayılan: null
  • Type: String

A client certificate to pass when accessing the registry. Values should be in PEM format (AKA "Base-64 encoded X.509 (.CER)"). For example:


It is not the path to a certificate file (and there is no certfile option).


  • Varsayılan: null
  • Tip: url

A proxy to use for outgoing HTTPS requests. If the HTTPS_PROXY, https_proxy, HTTP_PROXY or http_proxy environment variables are set, their values will be used instead.


  • Varsayılan: null
  • Type: String

A client key to pass when accessing the registry. Values should be in PEM format (AKA "Base-64 encoded X.509 (.CER)"). For example:

key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----"

It is not the path to a key file (and there is no keyfile option).


  • Default: undefined
  • Type: IP Address

The IP address of the local interface to use when making connections to the npm registry.


  • Varsayılan: null
  • Tip: url

A proxy to use for outgoing http requests. If the HTTP_PROXY or http_proxy environment variables are set, proxy settings will be honored by the underlying request library.


Added in: v6.18.0

  • Default: network-concurrency x 3
  • Tip: Sayı

The maximum number of connections to use per origin (protocol/host/port combination).


Added in: v5.18.8

  • Varsayılan: null
  • Type: String

A comma-separated string of domain extensions that a proxy should not be used for.


  • Default: true
  • Tip: Boolean

Whether or not to do SSL key validation when making requests to the registry via HTTPS.

See also the ca option.


  • Default: 16
  • Tip: Sayı

Controls the maximum number of HTTP(S) requests to process simultaneously.


  • Default: 2
  • Tip: Sayı

How many times to retry if pnpm fails to fetch from the registry.


  • Default: 10
  • Tip: Sayı

The exponential factor for retry backoff.


  • Default: 10000 (10 seconds)
  • Tip: Sayı

The minimum (base) timeout for retrying requests.


  • Varsayılan: 60000 (1 minute)
  • Tip: Sayı

The maximum fallback timeout to ensure the retry factor does not make requests too long.


Sürüm 6.2.0 ve sonrasında geçerli

  • Varsayılan: 60000 (1 minute)
  • Tip: Sayı

The maximum amount of time to wait for HTTP requests to complete.

Peer Dependency Settings


Added in: v6.26.0

  • Varsayılan: false
  • Tip: Boolean

When true, any missing non-optional peer dependencies are automatically installed.


Sürüm 2.15.0 ve sonrasında geçerli

  • Varsayılan: false
  • Tip: Boolean

If this is enabled, commands will fail if there is a missing or invalid peer dependency in the tree.

CLI Settings


Sürüm 4.1.0 ve sonrasında geçerli

  • Varsayılan: auto
  • Type: auto, always, never

Controls colors in the output.

  • auto - output uses colors when the standard output is a terminal or TTY.
  • always - ignore the difference between terminals and pipes. You’ll rarely want this; in most scenarios, if you want color codes in your redirected output, you can instead pass a --color flag to the pnpm command to force it to use color codes. The default setting is almost always what you’ll want.
  • never - turns off colors. This is the setting used by --no-color.


Added in: v4.13.0

  • Default: info
  • Type: debug, info, warn, error

Any logs at or higher than the given level will be shown. You can instead pass --silent to turn off all output logs.


Sürüm 3.6.0 ve sonrasında geçerli

  • Varsayılan: false
  • Tip: Boolean

Experimental option that enables beta features of the CLI. This means that you may get some changes to the CLI functionality that are breaking changes, or potentially bugs.


Added in: v5.4.0

  • Default: true
  • Tip: Boolean

If this is enabled, the primary behaviour of pnpm install becomes that of pnpm install -r, meaning the install is performed on all workspace or subdirectory packages.

Else, pnpm install will exclusively build the package in the current directory.


  • Varsayılan: false
  • Tip: Boolean

If this is enabled, pnpm will not install any package that claims to not be compatible with the current Node version.

Regardless of this configuration, installation will always fail if a project (not a dependency) specifies an incompatible version in its engines field.


Sürüm 4.8.0 ve sonrasında geçerli

  • Type: path

The location of the npm binary that pnpm uses for some actions, like publishing.

Build Settings


  • Default: 5
  • Tip: Sayı

The maximum number of child processes to allocate simultaneously to build node_modules.


Added in: v1.31.0

  • Varsayılan: false
  • Tip: Boolean

Use and cache the results of (pre/post)install hooks.


Added in: v1.31.0

  • Varsayılan: false
  • Tip: Boolean

Only use the side effects cache if present, do not create it for new packages.


  • Default: false IF running as root, ELSE true
  • Tip: Boolean

Set to true to enable UID/GID switching when running package scripts. If set explicitly to false, then installing as a non-root user will fail.

Node.js Settings


Sürüm 6.5.0 ve sonrasında geçerli

  • Default: undefined
  • Type: semver

Specifies which exact Node.js version should be used for the project's runtime. pnpm will automatically install the specified version of Node.js and use it for running pnpm run commands or the pnpm node command.


Added in: v6.24.0

  • Default:<releaseDir>/
  • Type: URL

Sets the base URL for downloading Node.js. The <releaseDir> portion of this setting can be any directory from release, rc, nightly, v8-canary, etc.

Here is how pnpm may be configured to download Node.js from Node.js mirror in China:


Other Settings


Added in: v2.5.0

  • Varsayılan: false
  • Tip: Boolean

Only allows installation with a store server. If no store server is running, installation will fail.


  • Default: '^'
  • Type: String

Configure how versions of packages installed to a package.json file get prefixed.

For example, if a package has version 1.2.3, by default its version is set to ^1.2.3 which allows minor upgrades for that package, but after pnpm config set save-prefix='~' it would be set to ~1.2.3 which only allows patch upgrades.

This setting is ignored when the added package has a range specified. For instance, pnpm add foo@2 will set the version of foo in package.json to 2, regardless of the value of save-prefix.


  • Default: latest
  • Type: String

If you pnpm add a package and you don't provide a specific version, then it will install the package at the version registered under the tag from this setting.

This also sets the tag that is added to the package@version specified by the pnpm tag command if no explicit tag is given.


Added in: v4.2.0

  • Default: <path to node>/pnpm-global
  • Type: path

Specify a custom directory to store global packages.


Sürüm 6.15.0 ve sonrasında geçerli

Allows to set the target directory for the bin files of globally installed packages.


Added in: v6.10.0

  • Default: $XDG_STATE_HOME/pnpm
  • Type: path

The directory where pnpm creates the pnpm-state.json file that is currently used only by the update checker.


Added in: v6.10.0

  • Default: $XDG_CACHE_HOME/pnpm
  • Type: path

The location of the package metadata cache.


Sürüm 6.5.0 ve sonrasında geçerli

  • Varsayılan: false
  • Tip: Boolean

When true, all the output is written to stderr.


Added in: v6.16.0

  • Default: true
  • Tip: Boolean

When false, the NODE_PATH environment variable is not set in the command shims. It is recommended to set this setting to false if you are getting the next error, when running commands:

The input line is too long. The syntax of the command is incorrect.


Added in: v6.29.0

  • Default: true
  • Tip: Boolean

Set to false to suppress the update notification when using an older version of pnpm than the latest.