If you are using asdf to install node versions like me, and also sometimes use yarn, you might be tempted to just run brew install yarn, but that will give you trouble when it brings down the node package as well.
See yarn installation instructions that suggests brew install yarn --without-node instead.