"eas build" gets failed on expo dev

It can be built locally and works fine, but when I build it with eas to submit the app, it fails on expo.dev

1. Running yarn in the root dir of your repository 
2. yarn install v1.22.17
3. [1/4] Resolving packages...
4. [2/4] Fetching packages...
5. [stderr] error fsevents@2.3.2: The platform "linux" is incompatible with this module.
6. [stderr] error Found incompatible module.
7. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
8. yarn exited with non-zero code: 1

fsevents is used on dependencies.

When you say it can be built locally, how are you building locally?

fsevents should not be a direct dependency of your app. i.e. it should not be listed in your package.json. It is used on macOS, I believe, because it’s a dependency of a dependency of … react-native or something like that. But it’s only used optionally. If you manually install it as a dependency then it will cause problems when you’re trying to build your app on the Expo build servers, which run Linux, because the fsevents package is not compatible with Linux.

1 Like

What I mean locally was that is building with expo start --android or expo build:android.
fsevents is not listed directly, but it is using in other packages. Let me share my package.json.

  "main": "./src/index.js",
  "name": "",
  "scripts": {
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "ios:build": "expo build:ios",
    "android:build": "expo build:android",
    "web:build": "expo build:web",
    "start": "react-native start",
    "test": "./node_modules/.bin/jest --passWithNoTests --forceExit --detectOpenHandles",
    "test:watch": "./node_modules/.bin/jest --passWithNoTests --runInBand --detectOpenHandles --forceExit --watchAll",
    "eslint": "npx eslint . --ext .ts,.tsx,.js",
    "prettier:write": "prettier --write ./src/**",
    "prettier": "prettier --dry-run ./src/**"
  "dependencies": {
    "@expo/vector-icons": "^12.0.0",
    "@humanity.cash/types": "^0.0.2",
    "@react-native-async-storage/async-storage": "1.15.0",
    "@react-native-community/datetimepicker": "3.5.2",
    "@react-native-community/masked-view": "0.1.10",
    "@react-native-community/viewpager": "5.0.11",
    "@react-navigation/bottom-tabs": "^5.7.0",
    "@react-navigation/drawer": "^5.12.5",
    "@react-navigation/material-top-tabs": "^5.2.16",
    "@react-navigation/native": "^5.7.0",
    "@react-navigation/stack": "^5.7.0",
    "@types/lodash": "^4.14.159",
    "@types/react-native-read-more-text": "^1.0.1",
    "@types/react-native-svg-charts": "^5.0.3",
    "amazon-cognito-identity-js": "^5.0.6",
    "axios": "^0.21.1",
    "eslint-plugin-jest": "^24.3.6",
    "expo-asset": "~8.3.3",
    "expo-barcode-scanner": "~10.2.2",
    "expo-brightness": "^9.2.2",
    "expo-constants": "~11.0.1",
    "expo-font": "~9.2.1",
    "expo-image-manipulator": "^9.2.2",
    "expo-image-picker": "~10.2.2",
    "expo-intent-launcher": "~9.1.0",
    "expo-local-authentication": "~11.1.1",
    "expo-mail-composer": "10.2.2",
    "expo-permissions": "~12.1.1",
    "expo-splash-screen": "~0.11.2",
    "expo-status-bar": "~1.0.4",
    "expo-updates": "~0.8.2",
    "faker": "^5.5.3",
    "fuse.js": "^6.4.6",
    "jest": "^27.0.3",
    "lodash": "^4.17.19",
    "moment": "^2.27.0",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-hookstore": "^1.4.4",
    "react-native": "^0.63.4",
    "react-native-camera": "^4.0.0",
    "react-native-chart-kit": "^6.5.0",
    "react-native-dotenv": "^3.2.0",
    "react-native-dropdown-picker": "^5.1.27",
    "react-native-elements": "^2.1.0",
    "react-native-fit-image": "^1.5.5",
    "react-native-gesture-handler": "~1.10.2",
    "react-native-mask-input": "^1.1.1",
    "react-native-modal-datetime-picker": "^13.0.0",
    "react-native-paper": "^4.9.2",
    "react-native-pdf": "^6.2.0",
    "react-native-permissions": "^2.1.5",
    "react-native-picker-select": "^7.0.0",
    "react-native-qrcode-svg": "^6.1.1",
    "react-native-read-more-text": "^1.1.2",
    "react-native-reanimated": "~2.2.0",
    "react-native-safe-area-context": "3.2.0",
    "react-native-screens": "~3.4.0",
    "react-native-select-dropdown": "^1.1.0",
    "react-native-svg": "12.1.1",
    "react-native-svg-charts": "^5.4.0",
    "react-native-tab-view": "^2.15.1",
    "react-native-toast-message": "^1.6.0",
    "react-native-touch-id": "^4.4.1",
    "react-native-unimodules": "~0.14.5",
    "react-native-vector-icons": "^7.0.0",
    "react-native-web": "~0.13.12",
    "react-native-webview": "11.6.2",
    "uuid4": "^2.0.2"
  "devDependencies": {
    "@babel/core": "~7.9.0",
    "@types/react": "~16.9.35",
    "@types/react-dom": "~16.9.8",
    "@types/react-native": "~0.63.2",
    "@typescript-eslint/eslint-plugin": "^4.8.1",
    "@typescript-eslint/parser": "^4.8.1",
    "babel-preset-expo": "8.3.0",
    "eslint": "^7.13.0",
    "eslint-config-prettier": "^6.15.0",
    "eslint-config-standard": "^16.0.1",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-jest": "^24.3.6",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-spellcheck": "^0.0.19",
    "expo": "^42.0.0",
    "jest-expo": "^38.0.0",
    "prettier": "2.5.1",
    "typescript": "~4.0.0"
  "jest": {
    "preset": "react-native"
  "private": true

Did you mean expo run:android? One thing to be aware of: If you do not clean up afterwards you are now on the bare workflow.

If you did mean expo start --android then that does not build locally. It just runs Expo Go on a connected emulator/device.

While I would not expect this to cause the error you’re seeing, this is not currently supported by EAS Build.

I’ve just tried building a test app with your dependencies and I believe the problem is caused by @humanity.cash. From yarn.lock:

  version "0.0.2"
  resolved "https://registry.yarnpkg.com/@humanity.cash/types/-/types-0.0.2.tgz#5f4c16c3236b111fa4022400206ec07865ad1707"
  integrity sha512-8IvheCCYDH871AElLQj6iJN5GrLED5UR8qliGeuwjh7rTV5+9qJwl4ycQLnf2JeVcQDV6dPiFd/0LsgMpV59JQ==
    fsevents "^2.3.2"

As you can see, fsevents is a dependency of @humanity.cache/types. All of the other references to it look like this:

    fsevents "~2.3.2"

I believe this is how it should be. It should be an optional dependency.

You can probably fix this by patching the package using patch-package.
EDIT: I don’t think you can fix this with patch-package because patch-package does its thing after the package has already been installed.

On the other hand, I believe those dependencies that just provide TypeScript typing information should be in your devDependencies rather than your dependencies. See if it builds after you move them.

1 Like

I’ve updated @humanity.cash, then it works to me. Thanks wordin!!!

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.