Navigate:
All Reposcorepack
~$COREPA0.2%

Corepack: Package manager version manager for Node.js

Enforces package manager versions specified in package.json.

LIVE RANKINGS • 06:52 AM • STEADY
OVERALL
#144
5
30 DAY RANKING TREND
ovr#144
STARS
3.4K
FORKS
239
DOWNLOADS
2.2M
7D STARS
+6
7D FORKS
0
See Repo:
Share:

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.


1

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.

2

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.

3

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);
}

vv0.34.3

Maintenance release updating bundled package manager versions and fixing Yarn install behavior.

  • Update to latest bundled versions of npm, pnpm, and Yarn for improved compatibility.
  • Fix Yarn switch command to properly support installation and add test coverage for the feature.
vv0.34.2

Maintenance release updating bundled package manager versions and fixing a race condition in tar extraction.

  • Update to latest npm, pnpm, and yarn versions bundled with Corepack (specific versions not listed in notes).
  • Fix race condition in node-tar extraction that could cause intermittent failures during package manager installation.
vv0.34.1

Patch release fixing a registry origin validation bug and updating bundled package manager versions.

  • Fixes incorrect registry origin check that could affect custom registry configurations.
  • Updates default package manager versions (pnpm, yarn, npm) to latest stable releases.


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers