Skip to content

[Bug?]: set version issue #6310

Closed
Closed
@hangya-fadir

Description

@hangya-fadir

Self-service

  • I'd be willing to implement a fix

Describe the bug

in case the global yarn version is 1.22.21 i can't switch to yarn 4.2.2 if the package.json already contains "packageManager": "[email protected]"

NOTE: this is used in Ci/CD pipeline, e.g no way to leave the project folder

error This project's package.json defines "packageManager": "[email protected]". However the current global version of Yarn is 1.22.21.

Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.

To reproduce

  1. yarn set version 1.22.21
  2. git clone <your project with [email protected]>
  3. yarn -> see the console for the error
  4. yarn set version XXXX
  5. yarn dlx XXX

Environment

System:
    OS: macOS 14.1
    CPU: (12) arm64 Apple M3 Pro
  Binaries:
    Node: 22.1.0 - /private/var/folders/5f/0b9zhgpd1g132gtzrlzlt7rh0000gn/T/xfs-5e99bc67/node
    Yarn: 4.2.2 - /private/var/folders/5f/0b9zhgpd1g132gtzrlzlt7rh0000gn/T/xfs-5e99bc67/yarn
    npm: 10.7.0 - ~/.nvm/versions/node/v22.1.0/bin/npm

Additional context

also the yarn dlx -q envinfo --preset jest is not working in the above case

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwaiting for feedbackWill autoclose in a while unless more data are provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions