Skip to content

Corepack should not download package manager if binary is available #586

Open
@trivikr

Description

@trivikr

Is your feature request related to a problem? Please describe.

Yarn has a configuration called yarnPath which allows yarn binary to be added in the repository.

The latest version of yarn, i.e. v4, recommends using corepack instead of yarnPath. However, corepack users do get CI failures sometimes because of network issues when downloading package manager. Example:

In aws-sdk-js-v3, we attempted to use yarnPath to set yarn binary, but we noticed that corepack still attempts to download binary even if it's available. Details in aws/aws-sdk-js-v3#6757 (comment)

A minimal repro can be viewed in https://github.com/trivikr/test-corepack-local-version

Describe the solution you'd like

Corepack should not download package manager if binary is available in the project.

Describe alternatives you've considered

  • Following up on existing issues which discuss network failures shared above.
  • Use globally installed yarn classic instead of corepack for managing yarn version.
  • Switch to npm@^10.9.0, and use devEngines instead of corepack packageManager field.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions