Yarn: Do i need to commit .yarn/releases folder to my repo?

Created on 6 Dec 2019  路  3Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
Feature (i think)
I believe i need to commit the full .yarn/releases folder into the repository for others to use. This means that a full build of yarn is added to my repo. It would be much more usable if the required release is automatically downloaded if it doesn't exist.

What is the current behavior?
Yarn crashes if the required version is not installed

module.js:549
    throw err;
    ^

Error: Cannot find module '/path/to/repository/.yarn/releases/yarn-1.19.2.js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

What is the expected behavior?
To install the specified yarn version if the file is not found.

All 3 comments

So far the answer seems to be _yes_. It becomes a hard-dependency of the project to run or even install as you intend.

Sooo... I am new to yarn, this question is exactly what I am trying to figure out. I am using Typescript and I need to make sure that other devs on this repo won't have an issue. I am assuming I need to commit the .yarn folder since this is added when I run yarn set version berry.

I see thumbsdown so I am confused as to what is proper procedure for this.

Also was confused.
From the docs: https://yarnpkg.com/cli/set/version

A very good use case for this command is to enforce the version of Yarn used by the any single member of your team inside a same project - by doing this you ensure that you have control on Yarn upgrades and downgrades (including on your deployment servers), and get rid of most of the headaches related to someone using a slightly different version and getting a different behavior than you.

So, I'm guessing it goes into the repo, indeed.

Was this page helpful?
0 / 5 - 0 ratings