Fork-ts-checker-webpack-plugin incompatible with Yarn

I’m trying to deploy a create-react-app app that I just updated from react-scripts 2.1.5 to 3.3.0. Building works just fine on my (macOs) computer, but when deploying to netlify, I’m getting this error:

12:10:02 PM: yarn install v0.18.1
12:10:02 PM: (node:1374) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
12:10:02 PM: [1/4] Resolving packages…
12:10:03 PM: [2/4] Fetching packages…
12:10:20 PM: warning fsevents@2.1.2: The platform “linux” is incompatible with this module.
12:10:20 PM: info “fsevents@2.1.2” is an optional dependency and failed compatibility check. Excluding it from installation.
12:10:20 PM: error fork-ts-checker-webpack-plugin@3.1.0: The engine “yarn” is incompatible with this module. Expected version “>=1.0.0”.
12:10:20 PM: error Found incompatible module
12:10:20 PM: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
12:10:20 PM: failed during stage ‘building site’: Build script returned non-zero exit code: 1

There is an issue on create-react-app’s Github which given solution is to delete and reinstall yarn. I tried the “clear the cache and deploy the site” option, ending with the same result.

Here is my package.json:

{
  "name": "cv",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^15.6.1",
    "react-dom": "^15.6.1",
    "react-redux": "^5.0.6",
    "react-router": "^4.2.0",
    "react-router-dom": "^4.2.2",
    "redux": "^3.7.2"
  },
  "devDependencies": {
    "react-scripts": "3.3.0"
  },
  "scripts": {
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build",
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ]
}

Hadn’t notice that netlify was using old the 0.18.1 yarn version.
Setting the YARN_VERSION build env var to something greater that 1.0.0 fixed this.

Thank you for sharing your solution, @iwazaru. This will hopefully help others with the same issue in the future.