volta
volta copied to clipboard
Respect yarn pinned through `yarn policies` but still allow Node pinning
tl;dr: can you make pinning yarn optional even if node is pinned?
I really like volta but I have this issue all the time. Our repos use yarn policies set-version (docs) to pin the version of yarn in the repo. This downloads a somewhat-minified js file containing a specific yarn version to (example) .yarn/releases/yarn-1.22.17.cjs. This is the standard way that yarn recommends pinning the version of yarn.
However, if I use volta to pin node and then try running yarn, I just get volta complaining that yarn hasn't been pinned. This behavior does not happen if I have volta installed but use it to pin nothing in my project. I could use volta to pin yarn... but now I have two separate sources of truth for yarn versions.
I really like volta as a solution to pin Node version because the story for pinning Node is awful (see this issue if you're not convinced!) and the Node project hasn't given guidance on it.
However, the maintainers of yarn have given guidance and provided a robust solution, a solution they're doubling down on with yarn berry. I hope volta will play nice with it. Thanks for the project!
Duplicate of #651 I believe