
Previously, you’d list in the nohoist option which packages should not be hoisted to the top-level node_modules folder, and all sub-packages would follow that. We used the nohoist option in our package.json, which has a slightly different behavior in Yarn 3. yarn/releases/yarn-1.22.11.cjs, which I won’t be needing anymore. yarnrc.yml (keep reading and you’ll know what issue does this excerpt hold here): I was actually using those to connect with my private npm repository. This took me some time to figure out, but Yarn looks for the yarn.locks outside the root folder to mark that dir as a possible node_modules-compatible sub-package. Also, if you plan on using Zero Install, go check that section for more on gitignoresĪlso go ahead and delete all yarn.lock files that aren’t in the root of your project. Here I recommend the gitignore plugin from oh-my-zsh, which allows me to just run gi yarn >.

yarnrc.yml file (we will try to enable this later) yarnrc, you’ll need to turn them into the new format (see also 1, 2)

Run yarn set version berry to enable v2 (cf Install for more details).Run npm install -g yarn to update the global yarn version to latest v1.

The migration guide from the Yarn team is great, I’ll take the liberty of copying it here for ease of access: I would glady stay with lerna, but after some tries I couldn’t get lerna to work with yarn 3, and it seems it won’t be supporting the new yarn versions anytime soon. We’ve been using lerna for our JavaScript monorepo project 2. Also, I may refer to Yarn as Yarn Berry or Yarn 3, they all mean the same thing, as Berry is the name of the repository post-v1. I’ve searched for the errors Yarn was outputting multiple times and didn’t find much help online, so I am adding all the errors I had here so that I can save you some time 1. Yes, get rid of yarn install via Zero Install. After sitting through a 15 minute yarn install I said “enough is enough” and I decided to migrate to the recently announced Yarn 3 with PnP support to get rid of our install process.
