Skip to content
Latchkey

corepack enable: Usage, Options & Common CI Errors

corepack enable turns on the bundled Yarn/pnpm shims that come with Node.js.

Corepack ships with Node and provides shims for Yarn and pnpm so you do not npm install -g them. corepack enable activates those shims; in CI it sometimes needs sudo and the right packageManager field.

What it does

corepack enable installs shims for yarn and pnpm into Node's bin directory, so the version is governed by the packageManager field in package.json rather than a global install. It is the modern, reproducible way to pin a package manager. Corepack is bundled with Node (it is no longer auto-enabled in newer Node, hence the explicit enable).

Common usage

Terminal
corepack enable
corepack enable pnpm                             # enable just pnpm
corepack prepare pnpm@9.5.0 --activate           # pin an exact version
# package.json: "packageManager": "pnpm@9.5.0"
pnpm install

Common errors in CI

"EACCES: permission denied, symlink ... /usr/local/bin/yarn" happens when Node's bin dir is root-owned - run corepack enable with sudo, or use a Node version manager whose bin dir you own. "Error: Cannot find matching keyid" / "Signature verification failed" appears when a Corepack version cannot verify a newer package-manager release; update Node/Corepack or pin a known version with corepack prepare. If yarn/pnpm is still "command not found" after enable, PATH does not include Node's bin dir.

Options

ItemWhat it does
enableInstall yarn and pnpm shims
enable <name>Enable a specific package manager
disableRemove the shims
prepare <pm>@<v> --activateDownload and activate an exact version

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →