One way to try to ensure a minimum version of node/yarn etc. is by added the engines section to the packages.json file, for example in the following we set the minimum version of node and yarn expected to work with this project
"engines": { "node": "12.*", "yarn": "1.21.*" }
See npm-package.json.