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
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 installCommon 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
| Item | What it does |
|---|---|
| enable | Install yarn and pnpm shims |
| enable <name> | Enable a specific package manager |
| disable | Remove the shims |
| prepare <pm>@<v> --activate | Download and activate an exact version |