Yarn > v1.22 is a very different beast than npm. After that version they introduced a "package-manager" field to package.json and yarn will install the specific version of yarn required by that package onto your root system and use that version.
There's probably some way to do that without messing with your root system but after I encountered that I went back to npm. Let something like nix handle the version of my build tool. Or at least install to my home directory like rustup or sbt.