Skip to content

Add corepack (instead of yarn) #12310

Closed as not planned
Closed as not planned
@SpecLad

Description

@SpecLad

Tool name

corepack

Tool license

MIT

Add or update?

  • Add
  • Update

Desired version

latest

Approximate size

1 MB (however, it's smaller than yarn, so this will actually decrease the image size)

Brief description of tool

Corepack provides shims for the Yarn and pnpm package managers that automatically download and run the version of the manager defined in package.json. Adding Corepack to the base image will let projects using pnpm and Yarn 2+ run these tools without an extra install step.

Currently, the runner images include Yarn 1.x. This should be deleted, as it will conflict with Corepack's yarn shim. The shim also uses Yarn 1.x by default in most cases, so most workflows should be unaffected by this change. The only observable incompatibility I could find is that yarn init will use Yarn 4.x if ran outside a project directory; however, since this command creates a new project, I would not expect to see it in a CI workflow.

URL for tool's homepage

https://github.com/nodejs/corepack

Provide a basic test case to validate the tool's functionality.

yarn --version
pnpm --version

Platforms where you need the tool

  • Azure DevOps
  • GitHub Actions

Runner images where you need the tool

  • Ubuntu 22.04
  • Ubuntu 24.04
  • macOS 13
  • macOS 13 Arm64
  • macOS 14
  • macOS 14 Arm64
  • macOS 15
  • macOS 15 Arm64
  • Windows Server 2019
  • Windows Server 2022
  • Windows Server 2025

Can this tool be installed during the build?

npm install -g corepack

# Note that currently Node.js bundles a version of corepack where the shims are disabled by default.
# This version is slated to be removed in Node 25, so I think it's best to ignore it,
# and just install the latest from NPM.

Tool installation time in runtime

Negligible

Are you willing to submit a PR?

Probably not

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions