Skip to content

Unsupported Yarn v1 Classic used as default after Corepack installation #812

@MikeMcC399

Description

@MikeMcC399

Current behavior

If a yarn create command is run following installation of Corepack, then the unsupported Yarn v1 Classic 1.22.22 is offered for download.

corepack/config.json

Lines 115 to 116 in fbe7f78

"yarn": {
"default": "1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610",

Expected behavior

The current version of Yarn should be proposed as default for download after installing Corepack. Currently that would mean selecting yarn@4.14.1 instead of yarn@1.22.22.

Yarn Classic v1.x is no longer supported and is marked as frozen since January 2020.

Yarn Modern v4 is the currently supported version of Yarn (see https://github.com/yarnpkg/berry/releases for current release information).

It should not be necessary to have executed

corepack install -g yarn

before executing yarn create.

The default Yarn version for the global install is yarn@4.14.1. It is inconsistent to have the global install for Yarn with no version specification default to Yarn v4, whereas with no global install Corepack is defaulting to Yarn v1.

Versions

Corepack 0.34.7
Ubuntu 24.04.4 LTS
Node.js 25.9.0 (Current)

Steps to reproduce

Install Node.js 25.9.0 LTS

rm -rf ~/.cache/node/corepack # if repeat testing
npm install -g corepack@latest
cd $(mktemp -d)
yarn create vite # see https://vite.dev/guide

Logs

$ cd $(mktemp -d)
yarn create vite # see https://vite.dev/guide
! Corepack is about to download https://registry.yarnpkg.com/yarn/-/yarn-1.22.22.tgz
? Do you want to continue? [Y/n]

Workaround

corepack install -g yarn

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