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.
Related Reading
Guides and comparisons from the Greptile content library
What is agentic coding? Benefits, risks, and best tools to consider
What engineering leaders need to know about agentic coding: how it differs from AI coding and vibe coding, how it works, the benefits and risks, and the tools worth evaluating.
What is Source Code Management (SCM): Everything Engineering Leaders Need to Know
Source code management is more than branching and merging. Here is how SCM works, the top tools, the best practices, and why good code review is the foundation of source control in an agentic era.
How to ACTUALLY Think About Code Reviews: The 3-Layer Checklist
A code review checklist and best practices organized around three layers — Mechanical, Structural, and Narrative — that help any team improve code quality without slowing reviews down.
Best SAST Tools for Engineering Teams [2026 Review]
We compare five of the best SAST tools (Semgrep, Checkmarx One, Snyk, Aikido, and GitHub CodeQL) on core functionality, languages, pricing, and fit, plus why static scanning needs runtime testing and full-codebase review alongside it.