Skip to content

[Bug] Home config interaction w/ Yarn 1 #2121

Open
@borekb

Description

@borekb

Describe the user story

If I have:

  • ~/.yarnrc.yml (home directory Yarnrc file) with yarnPath pointing to e.g. v1.22.10
  • ~/project/.yarnrc.yml (project-level Yarnrc file) with yarnPath pointing to e.g. v2.3.1

Then cd ~/project && yarn --version should yield version 2.3.1, not 1.22.10.

Describe the solution you'd like

Respect the closest Yarnrc file – it should have higher priority / take precedence over my global config.

Describe the drawbacks of your solution

Not sure if home directory's Yarnrc file isn't special somehow. Maybe some people depend on the current behavior?

Describe alternatives you've considered

N/A

Additional context

This was a major gotcha for one of my colleagues today, hard to debug. We were not sure why Yarn "misbehaves" when everything seemed correct. It turned out that there was a yarnPath in the home directory and that has overwritten our project setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingexternal bugThis issue highlights a bug in another projectupholdedReal issues without formal reproduction

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions