Error Install Dependencies in Build EAS

I have an expo application running in the store and I am making some updates, when I want to generate the APK of my application it tells me that I can no longer use expo:build and I must use eas, I have already done all the necessary steps to send it to build the always throws the same error when installing dependencies

Running "npm install" in the root dir of your repository 
 2 [stderr] npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
 3 [stderr] npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
 4 [stderr] npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
 5 [stderr] npm
 6 [stderr] WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
 7 [stderr] npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
 8 [stderr] npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
 9 [stderr] npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
10 [stderr] npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
11 [stderr] npm WARN deprecated
12 [stderr] uglify-es@3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
13 [stderr] npm WARN
14 [stderr] deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
15 [stderr] npm WARN deprecated chokidar@1.7.0: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
16 [stderr] npm WARN
17 [stderr] deprecated coffee-script@1.8.0: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
18 [stderr] npm WARN deprecated
19 [stderr] @react-native-community/masked-view@0.1.11: Repository was moved to @react-native-masked-view/masked-view
20 [stderr] npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
21 [stderr] npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
22 [stderr] npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
23 [stderr] npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
24 [stderr] npm WARN
25 [stderr] deprecated mkdirp@0.3.5: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
26 [stderr] npm WARN
27 [stderr] deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
28 [stderr] npm WARN deprecated connect@2.30.2: connect 2.x series is deprecated
29 [stderr] npm WARN deprecated core-js@1.2.7: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
30 [stderr] npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
31 [stderr] npm ERR! code ENOENT
32 [stderr] npm ERR!
33 [stderr] syscall chmod
34 [stderr] npm ERR! path /home/expo/workingdir/build/node_modules/pod/node_modules/pm2/bin/pm2
35 [stderr] npm ERR! errno -2
36 [stderr] npm ERR! enoent ENOENT: no such file or directory, chmod '/home/expo/workingdir/build/node_modules/pod/node_modules/pm2/bin/pm2'
37 [stderr] npm ERR! enoent This is related to npm not being able to find a file.
38 [stderr] npm ERR! enoent
39 [stderr]
40 [stderr] npm ERR!
41 [stderr] A complete log of this run can be found in:
42 [stderr] npm ERR!     /home/expo/.npm/_logs/2023-01-11T17_18_49_914Z-debug-0.log
43 npm exited with non-zero code: 254

Hi @djarquin01

It looks like you have one or more outdated dependencies.

Please post the link for the failed build (so that an Expo team member can check the logs there if they see your post).

Also, please post the dependencies and devDependencies from the “Read package.json” section of the logs here.

Thank you very much for the help, the Build Failled link is

What seems curious to me is that the application compiles and runs fine in Expo Go, but when doing the Build it generates the errors

Hi

Only Expo team members can access your build logs, so I can’t see them. In case one of them does not have a chance to investigate, can you please copy the dependencies/devDependencies from the logs here?

Expo Go includes all the native code from the Expo SDK, and it does not include any other native dependencies. Also, the Classic expo build process builds in all of the native code from the Expo SDK, and no native code from any other dependencies. Also, the versions of those dependencies are all the ones that the Expo team has determined to be compatible with each other.

So it’s very different to EAS Build. EAS Build is much more powerful, but unfortunately this means that if your dependencies are not quite right, they could accidentally work in Expo Go or expo build when there is actually a problem with them.

"dependencies": {
    "@expo/vector-icons": "^13.0.0",
    "@expo/webpack-config": "~0.16.2",
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-community/checkbox": "^0.5.12",
    "@react-native-community/datetimepicker": "6.1.2",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "8.2.0",
    "@react-navigation/drawer": "^6.4.3",
    "@react-navigation/native": "^6.0.10",
    "@react-navigation/stack": "^6.2.1",
    "@rneui/base": "^4.0.0-rc.5",
    "@rneui/themed": "^4.0.0-rc.5",
    "big-integer": "^1.6.51",
    "distributions": "^2.1.0",
    "expo": "~45.0.0",
    "expo-checkbox": "~2.1.0",
    "expo-device": "~4.2.0",
    "expo-linear-gradient": "~11.3.0",
    "expo-status-bar": "~1.3.0",
    "expo-updates": "~0.13.2",
    "get-media": "^1.0.2",
    "get-normal-distribution": "^1.0.0",
    "jstat": "^1.9.6",
    "moment": "^2.29.3",
    "normal-distribution": "^1.1.1",
    "norminv": "^2.0.0",
    "picker": "^0.1.4",
    "pod": "^0.9.0",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-native": "0.68.2",
    "react-native-date-picker": "^4.2.2",
    "react-native-dotenv": "^3.3.1",
    "react-native-flash-message": "^0.3.1",
    "react-native-gesture-handler": "~2.2.1",
    "react-native-get-media": "^1.0.2",
    "react-native-image": "^0.1.1",
    "react-native-picker-select": "^8.0.4",
    "react-native-safe-area-context": "^4.2.4",
    "react-native-screens": "~3.11.1",
    "react-native-uuid": "^2.0.1",
    "react-native-vector-icons": "^9.2.0",
    "react-native-virtualized-view": "^1.0.0",
    "react-native-web": "0.17.7",
    "react-native-webview": "^11.18.1",
    "react-router-native": "^5.3.2",
    "tvm-financejs": "^0.3.0",
    "webpack-dev-server": "~3.11.0"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "babel-preset-react-native": "^4.0.1"
  },

Hi

As it says in " Bundling with webpack":

If you need to edit the config the best way to do this is by running npx expo customize webpack.config.js. This will install @expo/webpack-config as a dev dependency and create a template ./webpack.config.js in your project.

So I’d expect to see this in devDependencies rather than dependencies.

This is deprecated. These days you should use @react-native-masked-view/masked-view

I’m not familiar with these two, but they stood out to me. Just based on the names they seem like they might do the same thing. Maybe you don’t need both? Not necessarily a problem, but best to remove dependencies you are not using/don’t need.

This one looks suspicious. There’s something called “pod” that’s used for iOS development (and e.g. if you are using the Bare workflow), but the above is something completely different. Maybe you’re using it for deploying the web version of your app? But I see their documentation instructs you to install it globally. Again, maybe this is not a problem, but looks suspicious to me. Also should be in devDependencies if you do have it installed on purpose.

Remove this. You don’t need to install it manually. It is a dependency of @expo/webpack-config, so you’ll get it automatically.

This is deprecated and you don’t need it. Remove it. @babel/core is all you need here.

@wodin Thank you very much for all your help, thanks to all these comments and the application builds with the new eas, but when generating the APK and installing it on a device, the application enters Splash and then exits by itself

Some dependencies are incompatible with the installed expo package version:

  • react-native-safe-area-context - expected version: 4.2.4 - actual version installed: 4.3.3

And I have dependecies “react-native-safe-area-context”: “4.2.4”,

Running "expo doctor"

2

- Finding all copies of expo-modules-autolinking

3

- Finding all copies of @expo/config-plugins

4

- Finding all copies of @expo/prebuild-config

5

- Finding all copies of @unimodules/core

6

- Finding all copies of @unimodules/react-native-adapter

7

- Finding all copies of react-native-unimodules

8[stderr]

[17:22:58] Some dependencies are incompatible with the installed expo package version:

9[stderr]

[17:22:58]  - react-native-safe-area-context - expected version: 4.2.4 - actual version installed: 4.3.3

10[stderr]

[17:22:58] Your project may not work correctly until you install the correct versions of the packages.

11[stderr]

To install the correct versions of these packages, please run: expo doctor --fix-dependencies,

12[stderr]

or install individual packages by running expo install [package-name ...]

13

Command "expo doctor" failed.

bash exited with non-zero code: 1

Running expo-cli doctor --fix-dependencies should fix those warnings, but might not fix the crash.

See the following page: Production errors

I have reviewed each of the errors in detail and I think that the problem may be generated by this gradle plugin

> Task :react-native-gradle-plugin:compileJava

44[stderr]

Note: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/java/com/facebook/react/codegen/generator/SchemaJsonParser.java uses or overrides a deprecated API.
```**strong text**
45[stderr]

Note: Recompile with -Xlint:deprecation for details.

That is a warning and not an error. It is not the cause of your problem.

Try runnung npx expo start --no-dev --minify to mske the development environment closer to the production environment. Then load the app in a dev build. Hopefully that will give you more information about what is going wrong.

Execute the command that you indicated npx expo start --no-dev --minify but in the same way the application in expo go executes correctly, when publishing it enters the splash and exits on its own

I am not 100% sure of what you are saying.

Did you create a development build?
Did you run npx expo start --no-dev --minify and then load the app in the development build instead of Expo Go?
What happened when you did this?

If this all worked as it should with no crash, then that’s unfortunate.

OK, can you get the device logs? Connect the device to your PC using a USB cable. Make sure USB debugging is enabled on the device. Run the app until it crashes. Then in the terminal, run:

adb logcat -d >logcat.txt

Then open logcat.txt and search for “FATAL” or “crash” and see what error messages were logged.

If none of the above helps, you might have to do some “manual debugging”