Yarn V4 & Corepack prints error about not respecting the packageManager version

This happened as I’m migrating from Yarn V1 to V4.
Looks like Travis starts with an outdated default Yarn version.
It prints the error log even before the “before_install” step is run, so it’s not possible to resolve it by ourselves.
The build still passes, so this is not a blocker.
Setting cache.yarn to false makes the error disappear.

Error:

error This project's package.json defines "packageManager": "yarn@4.3.1". However the current global version of Yarn is 1.22.22.
Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.

Minimal reproduction: Reproduce bug - Travis & yarn v4 & corepack · GitHub

I’d like to be able to configure the default Yarn version (before the before_install step!).