Nathan Tew
Nathan Tew

Reputation: 747

How does Yarn install decide whether to throw YN0070 and use node_modules vs PnP?

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.

Upvotes: 1

Views: 709

Answers (0)

Related Questions