versioned_docs_archived/version-3.x/npmrc.md
pnpm gets its config settings 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:
pnpm-workspace.yaml file)~/.npmrc)$PREFIX/etc/npmrc)All .npmrc files are an ini-formatted list of key = value parameters.
Force pnpm to always require authentication when accessing the registry, even for GET requests.
The Certificate Authority signing certificate that is trusted for SSL connections to the registry. Values should be in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string "\n". For example:
ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
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:
ca[]="..."
ca[]="..."
See also the strict-ssl config.
A path to a file containing one or multiple Certificate Authority signing certificates. Similar to the ca setting, but allows for multiple CA’s, as well as for the CA information to be stored in a file on disk.
A client certificate to pass when accessing the registry. Values should be in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string "\n". For example:
cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
It is not the path to a certificate file (and there is no "certfile" option).
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
homedir on the disk, then the store is created in the root. For example, if installation is happening on disk D
then the store will be created in D:\.pnpm-store.
It is possible to set a store from a different disk but in that case pnpm will copy, not link, packages from the store. Hard links are possible only inside a filesystem.
Controls the maximum number of HTTP requests that can be done simultaneously.
Controls the number of child processes run parallelly to build node modules.
Dangerous! If false, the store is not locked. It means that several installations using the same store can run simultaneously.
Can be passed in via a CLI option. --no-lock to set it to false. E.g.: pnpm install --no-lock.
If you experience issues similar to the ones described in #594, use this option to disable locking. In the meanwhile, we'll try to find a solution that will make locking work for everyone.
If true, symlinks leaf dependencies directly from the global store. Leaf dependencies are
packages that have no dependencies of their own. Setting this config to true might break some packages
that rely on location but gives an average of 8% installation speed improvement.
Added in: v1.8.0
If false, doesn't check whether packages in the store were mutated.
Added in: v1.25.0
Controls the way packages are imported from the store.
Added in: v1.32.0 (initially named shrinkwrap)
When set to false, pnpm won't read or generate a pnpm-lock.yaml file.
Added in: v1.37.1 (initially named prefer-frozen-shrinkwrap)
When true and the available pnpm-lock.yaml satisfies the package.json
then a headless installation is performed. A headless installation is faster than a regular one
because it skips dependencies resolution and peers resolution.
Added in: v2.5.0
Only allows installation with a store server. If no store server is running, installation will fail.
Added in: v1.31.0
Stability: Experimental
Use and cache the results of (pre/post)install hooks.
Added in: v1.31.0
Stability: Experimental
Only use the side effects cache if present, do not create it for new packages.
Added in: v1.34.0
If true, pnpm creates a flat node_modules that look almost like a node_modules created by npm or Yarn.
Please only use this option when there is no other way to make a project work with pnpm.
The strict node_modules created by pnpm should always work, if it does not, most likely a dependency is
missing from package.json. Use this config only as a temporary fix.
Added in: v2.15.0
If true, commands fail on missing or invalid peer dependencies.
Added in: v3.1.0
Sets the resolutions strategy used during installation.
Added in: v3.6.0
When true, beta features of the CLI are used. This means that you may get some changes to the CLI functionality
that are breaking changes.
If set to true, then pnpm will stubbornly refuse to install (or even consider installing) any package that claims to not be compatible with the current Node.js version.
Regardless of this config, installation will always fail when a project (not a dependency) will specify an
incompatible pnpm version in its engines field.
The "retries" config for the retry module to use when fetching packages from the registry.
The "factor" config for the retry module to use when fetching packages.
The "minTimeout" config for the retry module to use when fetching packages.
The "maxTimeout" config for the retry module to use when fetching packages.
A proxy to use for outgoing https requests. If the HTTPS_PROXY or https_proxy or
HTTP_PROXY or http_proxy environment variables are set, proxy settings will be honored by the underlying request library.
A client key to pass when accessing the registry. Values should be in PEM format with newlines replaced by the string "\n". 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).
The IP address of the local interface to use when making connections to the npm registry. Must be IPv4 in versions of Node prior to 0.12.
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.
The base URL of the npm package registry.
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 config is ignored when the added package has a range specified. For instance,
pnpm add foo@2 will add 2 to package.json, regardless of the value of save-prefix.
Whether or not to do SSL key validation when making requests to the registry via https.
See also the ca config.
If you ask pnpm to install a package and don’t tell it a specific version, then it will install the specified tag.
Also the tag that is added to the package@version specified by the pnpm tag command, if no explicit tag is given.
Set to true to suppress the UID/GID switching when running package scripts. If set explicitly to false, then installing as a non-root user will fail.