Corepack: Package manager version manager for Node.js
Enforces package manager versions specified in package.json.
Learn more about Corepack
Corepack is a zero-runtime-dependency Node.js utility that acts as a bridge between Node.js projects and their configured package managers. It works by intercepting calls to package managers and validating them against the project's packageManager field in package.json, downloading and caching the specified version if needed. The tool supports Yarn, npm, and pnpm, with optional SHA-224 hash validation for security. Corepack is distributed with Node.js versions 14.19.0 through 24.x and can be enabled via the corepack enable command or installed separately via npm.
Included with Node.js
Ships with Node.js 14.19.0+ and requires only `corepack enable` to activate. Eliminates global package manager installations and version conflicts across projects without additional tooling.
Project-Level Package Manager Enforcement
Reads the `packageManager` field in package.json and automatically uses the specified version with optional SHA-224 validation. Prevents team members from using wrong package managers or versions that cause inconsistent lockfiles.
Zero Runtime Dependencies
Implemented as a standalone Node.js script with no external dependencies. Downloads and caches package managers on-demand rather than bundling them, keeping the installation footprint minimal.
import { Engine } from 'corepack';
const engine = new Engine();
const packageManager = await engine.findProjectSpec(process.cwd());
if (packageManager) {
console.log(`Project uses: ${packageManager.name}@${packageManager.reference}`);
await engine.ensurePackageManager(packageManager);
}Documentation fixes for PowerShell functions and package manager version updates.
- –docs: fix PowerShell functions suggestions
- –update package manager versions
Fix for pnpm v11 bin path and package manager version updates.
- –pnpm: fix bin path for v11
- –update package manager versions
pnpm version bump and improvements to devEngines handling and POSIX link generation.
- –bump pnpm version in config.json
- –ignore devEngines version range when CLI provides a version
- –use lstatSync in generatePosixLink
Top in Developer Tools
Related Repositories
Discover similar tools and frameworks used by developers
Dompdf
CSS 2.1 compliant HTML layout and rendering engine.
StatsD
UDP/TCP metrics collector with pluggable backend support.
ts-node
Execute TypeScript directly without precompilation step.
Go
Statically typed, compiled language by Google focused on simplicity, concurrency, and fast compilation.
gogcli
Command-line interface for Gmail, Calendar, Drive, Contacts, and other Google services with JSON output.