Open
Description
Describe the user story
If I have:
~/.yarnrc.yml
(home directory Yarnrc file) withyarnPath
pointing to e.g. v1.22.10~/project/.yarnrc.yml
(project-level Yarnrc file) withyarnPath
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.