Fast, disk space efficient package manager for Node.js with hard links, symlinks, and monorepo support
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Manage the global package store, inspect cached packages, and optimize disk usage with pnpm's content-addressable storage operations.
Manage the global pnpm store where all packages are cached using content-addressable storage.
/**
* Manage the global package store
* Controls content-addressable storage for all packages
*/
pnpm store <command> [options]Available Commands:
status - Show store status and statisticspath - Show store directory pathprune - Remove unreferenced packages from storeadd - Add packages to store without installingUsage Examples:
# Show store status
pnpm store status
# Show store path
pnpm store path
# Clean up unused packages
pnpm store prune
# Add package to store
pnpm store add react@18.2.0Get detailed information about store usage, size, and package counts.
/**
* Show store status and statistics
* Displays store size, package count, and cleanup recommendations
*/
pnpm store status [options]Usage Examples:
# Show basic store status
pnpm store status
# Show detailed store information
pnpm store status --verboseDisplay the location of the global package store directory.
/**
* Show store directory path
* Returns absolute path to content-addressable store
*/
pnpm store path [options]Usage Examples:
# Show store path
pnpm store path
# Use store path in scripts
STORE_PATH=$(pnpm store path)Remove unreferenced packages from the store to reclaim disk space.
/**
* Remove unreferenced packages from store
* Cleans up packages not used by any project
*/
pnpm store prune [options]Options:
--force - Force removal without confirmation--dry-run - Show what would be removed without doing itUsage Examples:
# Prune unused packages (with confirmation)
pnpm store prune
# Force prune without confirmation
pnpm store prune --force
# Show what would be pruned
pnpm store prune --dry-runAdd packages to the store without installing them to any project.
/**
* Add packages to store without installing
* Pre-populates store for faster subsequent installs
*/
pnpm store add <pkg>[@version] [options]Usage Examples:
# Add package to store
pnpm store add react
# Add specific version
pnpm store add react@18.2.0
# Add multiple packages
pnpm store add react vue angularView the contents of files in the store using their content hash.
/**
* Show file contents from store by hash
* Displays content of files using content-addressable hash
*/
pnpm cat-file <hash> [options]Usage Examples:
# Show file contents by hash
pnpm cat-file 1a2b3c4d5e6f7890abcdef1234567890abcdef12
# Show file with specific encoding
pnpm cat-file --encoding=utf8 1a2b3c4d5e6fView the package index from the store showing package metadata and file structure.
/**
* Show package index from store
* Displays package metadata and file structure
*/
pnpm cat-index [options]Options:
--package <name> - Show index for specific package--registry <url> - Use specific registryUsage Examples:
# Show package index
pnpm cat-index
# Show index for specific package
pnpm cat-index --package react
# Show index from specific registry
pnpm cat-index --registry https://registry.npmjs.orgFind packages in the store that contain a specific hash.
/**
* Find packages containing specific hash
* Searches store for packages with matching content hash
*/
pnpm find-hash <hash> [options]Usage Examples:
# Find packages with hash
pnpm find-hash 1a2b3c4d5e6f7890
# Find with partial hash
pnpm find-hash 1a2b3cManage package cache for improved performance and storage optimization.
/**
* Manage package cache operations
* Controls caching behavior for faster installs
*/
pnpm cache <command> [options]Available Commands:
verify - Verify cache integrityclean - Clean cache dataUsage Examples:
# Verify cache integrity
pnpm cache verify
# Clean cache
pnpm cache cleanVerify the integrity of cached packages and metadata.
/**
* Verify cache integrity
* Checks cached packages for corruption or inconsistencies
*/
pnpm cache verify [options]Usage Examples:
# Verify all cached data
pnpm cache verify
# Verify with detailed output
pnpm cache verify --verboseClean cached data to free up disk space and resolve cache issues.
/**
* Clean cache data
* Removes cached metadata and temporary files
*/
pnpm cache clean [options]Options:
--force - Force cleaning without confirmationUsage Examples:
# Clean cache (with confirmation)
pnpm cache clean
# Force clean without confirmation
pnpm cache clean --forceConfigure the location of the global package store.
# Set store directory via config
pnpm config set store-dir /path/to/store
# Set via environment variable
export PNPM_STORE_PATH=/path/to/store
# Set via .pnpmrc file
store-dir=/path/to/storeConfigure store behavior and optimization settings.
# Store configuration options
store-dir # Store directory path
verify-store-integrity # Verify packages when adding to store
package-import-method # How to import packages (hardlink, copy, clone)Configuration Examples:
# Set store directory
pnpm config set store-dir ~/.pnpm-store
# Enable store verification
pnpm config set verify-store-integrity true
# Set package import method
pnpm config set package-import-method hardlinkUnderstanding pnpm's content-addressable storage system:
# Store structure
<store>/
├── v3/ # Store format version
│ ├── files/ # Content-addressable files
│ │ ├── 00/ # Hash-based directory structure
│ │ │ └── 1a2b3c... # File content by hash
│ └── metadata/ # Package metadata
└── tmp/ # Temporary filespnpm uses hard links and symlinks to share packages efficiently:
# Installation structure
node_modules/
├── .pnpm/ # Virtual store
│ ├── package@1.0.0/ # Actual package files (hard links to store)
│ └── node_modules/ # Dependency structure
└── package/ # Symlink to .pnpm/package@1.0.0Key advantages of pnpm's store architecture:
# Performance benefits
- Faster installs (packages cached globally)
- Reduced disk usage (shared packages via hard links)
- Atomic installs (packages linked, not copied)
- Offline installs (cached packages available)
# Security benefits
- Dependency isolation (hoisting limitations)
- Integrity verification (content-addressable hashing)
- Reproducible installs (deterministic linking)Resolve store corruption issues:
# Verify store integrity
pnpm store status
# Prune corrupted packages
pnpm store prune --force
# Clear cache if needed
pnpm cache clean --force
# Reinstall if corruption persists
rm -rf node_modules pnpm-lock.yaml
pnpm installManage disk space usage:
# Check store size
pnpm store status
# Remove unused packages
pnpm store prune
# Clean cache data
pnpm cache clean
# Move store to different location
pnpm config set store-dir /path/to/new/storeResolve store permission problems:
# Fix store permissions
chmod -R 755 $(pnpm store path)
# Use different store location
pnpm config set store-dir ~/.local/share/pnpm/store
# Run with specific user permissions
sudo -u $USER pnpm installStart and manage the pnpm store server for improved performance in development environments.
/**
* Manage pnpm store server
* Starts/stops background server for faster package operations
*/
pnpm server <command> [options]Commands:
start - Start the store serverstop - Stop the store serverstatus - Check server statusUsage Examples:
# Start store server
pnpm server start
# Check server status
pnpm server status
# Stop store server
pnpm server stopThe store server provides:
Install with Tessl CLI
npx tessl i tessl/npm-pnpm