pnpm Config and Store

Configuration, .npmrc, store/cache operations, and installation model settings.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

Configuration Basics

Read and write pnpm configuration.

Get config value

Read a pnpm configuration value.

bashANYpnpmconfig
bash
pnpm config get store-dir

Read a pnpm configuration value.

Set config value

Set a pnpm configuration value.

bashANYpnpmconfigstore
bash
pnpm config set store-dir ~/.pnpm-store

Set a pnpm configuration value.

Delete config value

Remove a config key.

bashANYpnpmconfig
bash
pnpm config delete store-dir

Remove a config key.

List config

Print active configuration values.

bashANYpnpmconfiginspect
bash
pnpm config list

Print active configuration values.

Create project .npmrc

Write common pnpm/npm-compatible configuration into .npmrc.

bashANYpnpmnpmrcconfig
bash
printf 'auto-install-peers=true
strict-peer-dependencies=false
' >> .npmrc

Write common pnpm/npm-compatible configuration into .npmrc.

Store and Cache

Inspect and clean the global pnpm store.

Show store path

Display the content-addressable store location.

bashANYpnpmstore
bash
pnpm store path

Display the content-addressable store location.

Show modified packages in store

Check whether packages in the store were modified.

bashANYpnpmstoreinspect
bash
pnpm store status

Check whether packages in the store were modified.

Prune unreferenced packages from store

Delete unreferenced packages from the global store.

bashANYpnpmstoreprune
bash
pnpm store prune

Delete unreferenced packages from the global store.

Show package metadata cache path

Print the path of pnpm's metadata cache.

bashANYpnpmcache
bash
pnpm cache path

Print the path of pnpm's metadata cache.

Delete package metadata cache entries

Clear package metadata cache entries.

bashANYpnpmcacheclear
bash
pnpm cache delete

Clear package metadata cache entries.

Node Linkers and Installation Modes

Configure how dependencies are linked and installed.

Use hoisted node_modules linker

Switch to a hoisted node_modules layout if needed for compatibility.

bashANYpnpmconfignode-linker
bash
pnpm config set node-linker hoisted

Switch to a hoisted node_modules layout if needed for compatibility.

Use isolated linker

Use pnpm's default strict linking model.

bashANYpnpmconfignode-linker
bash
pnpm config set node-linker isolated

Use pnpm's default strict linking model.

Enable shamefully-hoist

Hoist dependencies more aggressively for legacy tooling compatibility.

bashANYpnpmconfighoist
bash
pnpm config set shamefully-hoist true

Hoist dependencies more aggressively for legacy tooling compatibility.

Prefer offline installs

Use cached metadata and packages when possible.

bashANYpnpmconfigoffline
bash
pnpm config set prefer-offline true

Use cached metadata and packages when possible.

Configure store directory

Pin the store location explicitly.

bashANYpnpmconfigstore
bash
pnpm config set store-dir ~/.local/share/pnpm/store

Pin the store location explicitly.

Recommended next

No recommendations yet.