Navigate:
Corepack
~$COREP0.7%

Corepack: Package manager version manager for Node.js

Enforces package manager versions specified in package.json.

LIVE RANKINGS • 10:20 AM • STEADY
OVERALL
#183
14
DEVELOPER TOOLS
#33
2
30 DAY RANKING TREND
ovr#183
·Devel#33
STARS
3.5K
FORKS
244
7D STARS
+24
7D FORKS
+2
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.

Corepack

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.6

Documentation fixes for PowerShell functions and package manager version updates.

  • docs: fix PowerShell functions suggestions
  • update package manager versions
vv0.34.5

Fix for pnpm v11 bin path and package manager version updates.

  • pnpm: fix bin path for v11
  • update package manager versions
vv0.34.4

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


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers