[Bug?]: yarn set version berry adds the cjs and yarnPath
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8.1k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Self-service
- I'd be willing to implement a fix
Describe the bug
Following the migration guide and running yarn set version berry still adds the yarnPath in my .yarnrc.yml file while also downloading the cjs.
My expectation was that the cjs was not being added. In the release notes for yarn 4 its described that
Now that Corepack is shipped with both Node 18 and 20 we no longer need to rely on yarnPath, and as a result we updated our installation guide to reflect that. The yarn init -2 and yarn set version commands have been updated to favor updating the packageManager field when possible.
Corepack knows which package manager version to use thanks to the standard packageManager field in your package.json. This field will typically be set via one of yarn init -2, yarn set version x.y.z, or the more generic corepack use yarn@x.y.z.
To reproduce
Run yarn set version berry
Environment
System:
OS: macOS 14.3
CPU: (10) arm64 Apple M1 Pro
Binaries:
Node: 20.11.1 - /private/var/folders/js/46y7lvvd7nsb8w0ny71jt_6r0000gp/T/xfs-e44a5938/node
Yarn: 4.1.0 - /private/var/folders/js/46y7lvvd7nsb8w0ny71jt_6r0000gp/T/xfs-e44a5938/yarn
npm: 10.2.4 - /usr/local/bin/npm
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running yarn set version berry and inspect the resulting .yarnrc.yml and package.json. Compare the output with the migration guide and release notes; done means the command uses the expected packageManager configuration without adding an unnecessary yarnPath or CJS file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100