1

I have 2 different branches in my project. When I do yarn install in one of them, it starts off with:

➤ YN0070: Migrating from Yarn 1; automatically enabling the compatibility node-modules linker 

... then continues. This creates a .yarnrc.yml file and then installs the dependencies in node_modules.

In the other branch, however, that first message isn't shown, and Yarn's PnP is used instead. It creates .pnp.cjs and .pnp.loader.mjs files, and there is no node_modules directory.

What I don't understand is why there is a different behaviour. When I use VSCode to compare the two branches, I don't see any relevant differences in any files. Furthermore, these branches are freshly cloned and pulled from a remote repo, so it can't be any local changes to untracked files. (Which should remain the same bewteen branches anyway right...?)

My Yarn version is 3.3.0

Edit: I've realised that the difference in yarn.lock is responsible for this, but I don't know why.

Nathan Tew
  • 432
  • 1
  • 5
  • 21
  • Please read the document: https://yarnpkg.com/features/linkers. When `node_modules` folder exists, it won't enable PnP. – aleung Aug 29 '23 at 03:31

0 Answers0