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
Get config value
pnpm config get store-dir

# Read a pnpm configuration value.

Set config value
pnpm config set store-dir ~/.pnpm-store

# Set a pnpm configuration value.

Delete config value
pnpm config delete store-dir

# Remove a config key.

List config
pnpm config list

# Print active configuration values.

Create project .npmrc
printf 'auto-install-peers=true
strict-peer-dependencies=false
' >> .npmrc

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

## Store and Cache
Show store path
pnpm store path

# Display the content-addressable store location.

Show modified packages in store
pnpm store status

# Check whether packages in the store were modified.

Prune unreferenced packages from store
pnpm store prune

# Delete unreferenced packages from the global store.

Show package metadata cache path
pnpm cache path

# Print the path of pnpm's metadata cache.

Delete package metadata cache entries
pnpm cache delete

# Clear package metadata cache entries.

## Node Linkers and Installation Modes
Use hoisted node_modules linker
pnpm config set node-linker hoisted

# Switch to a hoisted node_modules layout if needed for compatibility.

Use isolated linker
pnpm config set node-linker isolated

# Use pnpm's default strict linking model.

Enable shamefully-hoist
pnpm config set shamefully-hoist true

# Hoist dependencies more aggressively for legacy tooling compatibility.

Prefer offline installs
pnpm config set prefer-offline true

# Use cached metadata and packages when possible.

Configure store directory
pnpm config set store-dir ~/.local/share/pnpm/store

# Pin the store location explicitly.

Recommended next

No recommendations yet.