Closed
Description
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
- yarn set version 1.22.21
- git clone <your project with [email protected]>
- yarn -> see the console for the error
- yarn set version XXXX
- 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