Following expo docs worked for me. Set
"scripts": { "eas-build-pre-install": "corepack enable && yarn set version 4" }
in your package.json