Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packageManager field incorrect #95

Open
leovigna opened this issue Feb 15, 2025 · 1 comment
Open

packageManager field incorrect #95

leovigna opened this issue Feb 15, 2025 · 1 comment

Comments

@leovigna
Copy link

leovigna commented Feb 15, 2025

Describe the bug
yarn installation breaks in Node v14+ as the packageManager field is incorrect (there is no yarn v4.5.1) and starting Node v14+ node enforces the packageManager field due to the introduction of corepack. There were discussions of removing corepack from the node distribution but regardless, this incorrect field breaks on many node versions when corepack is disabled because of the yarn version mismatch (interestingly, it works when corepack is enabled).

To Reproduce

  1. Use node 14+ nvm use 14 (if node installed with nvm)
  2. corepack disable (if currently enabled)
  3. yarn
  4. Breaks with the following message
error This project's package.json defines "packageManager": "[email protected]". However the current global version of Yarn is 1.22.22.
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.

Expected behavior
Proper installation.

Desktop (please complete the following information):

  • Linux
  • Node 14+ with corepack enabled

Solution

  • EDIT: Does NOT WORK. Unclear to me which yarn version the project uses but fix the packageManager field
  • Works: Add in README to make sure users enable corepack with corepack enable
@leovigna
Copy link
Author

leovigna commented Feb 15, 2025

Ok this was superconfusing but only solution seems to be to add the corepack enable to the README (in case user has it disabled) because there actuall IS a 4.5.1 of yarn but it's only shipped via corepack NOT through npmjs 🤕
This is why I prefer pnpm lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant