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

[Bug?]: Yarn's package.json itself does not include a packageManager field #6253

Open
1 task done
skagedal opened this issue Apr 27, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@skagedal
Copy link

Self-service

  • I'd be willing to implement a fix

Describe the bug

The instructions for contributing to Yarn (in the README or on the web page) do not mention anything about how to set up your development environment, it says that you should be able to just run yarn commands. One can only guess that enabled corepack is assumed – since that is the recommended way to use Yarn otherwise.

However, when running any command (such as yarn build:cli) with a corepack enabled yarn, the first thing that happens is:

❯ yarn build:cli
! The local project doesn't define a 'packageManager' field. Corepack will now add one referencing yarn@4.1.1+sha256.f3cc0eda8e5560e529c7147565b30faa43b4e472d90e8634d7134a37c7f59781.
! For more details about this field, consult the documentation at https://nodejs.org/api/packages.html#packagemanager

I understand that the idea is that after having run build:cli, you will use the locally built yarn to build itself. However, the repo still gets dirty. So I wonder what the idea is here – either it should be mentioned in the contribution docs on how to set up your development environment, or there should be a packageManager added to the package.json.

To reproduce

Run any yarn command inside the berry repo with corepack enabled.

Environment

When run inside the berry repo with HEAD at `52252b0`:

❯ yarn dlx -q envinfo --preset jest
! The local project doesn't define a 'packageManager' field. Corepack will now add one referencing yarn@4.1.1+sha256.f3cc0eda8e5560e529c7147565b30faa43b4e472d90e8634d7134a37c7f59781.
! For more details about this field, consult the documentation at https://nodejs.org/api/packages.html#packagemanager


  System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M2 Pro
  Binaries:
    Node: 22.0.0 - /private/var/folders/v6/x86jncgx39xf56z0zw_zfgp80000gn/T/xfs-c95a97e4/node
    Yarn: 4.1.1-dev - /private/var/folders/v6/x86jncgx39xf56z0zw_zfgp80000gn/T/xfs-c95a97e4/yarn
    npm: 10.5.1 - ~/Library/Caches/fnm_multishells/47146_1714204546801/bin/npm

Additional context

No response

@skagedal skagedal added the bug Something isn't working label Apr 27, 2024
@skagedal skagedal changed the title [Bug?]: Yarn's package.json itself does not incluee a packageManager field [Bug?]: Yarn's package.json itself does not include a packageManager field Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant