Which is better yarn or pnpm?

The most robust strategy is sticking to the ecosystem’s default package manager — NPM.

But in the end, all of this is about your personal preferences. Any modern solution will do. Use what you use for other projects.