How to stop Bazel from downloading yarn?

I have yarn installed locally and the path is set in an environment variable in my .bashrc:

export YARN_BINARY=/usr/bin/yarnpkg

When I start the build with ./run, it tries to download yarn every single time, which ends in the error

Error in fail: yarn_install failed: yarn install v1.19.1

. I’ve tried clearing the bazel cache at /home/user/.cache/bazel