Build failed after I installed a package

I have build simpler apps in the past and built them with “eas build” command before with no problem.

However it will fail to build if I install a package and try to build the app again.

the specific package I have downloaded is this GitHub - lhandel/react-native-card-flip: Card flip animation for React Native

I can not figure out how to include these dependency’s and make the build not fail.

The app works perfectly well when I am testing it with npx expo start command and run it with the expo app.

Hi @davidspartan95, it seems the package is quite old and the peer dependencies of that package might not be up to date. Latest version(s) of npm is quite strict in that regards. I’d suggest, either use yarn or set you can set --legacy-peer-deps flag in an EAS Build eas-build-pre-install hook

I will look into " set you can set --legacy-peer-deps flag in an EAS Build" for sure :face_with_monocle: thanks for the reply. I replay if I can get it working, atm I have long queue time so wont know if it work just yet.

1 Like

No problem at all. Let me know if it doesn’t work.

Sorry for the inconvenience regarding the queue time. We are working on it.

I worked together with someone else but I guess we were unable to figure out how/were to set the " --legacy-peer-deps flag", we tryed to put in in the package.json file under scriped. This resulted in a fail however.

–legacy-peer-deps is a command I used before when I downloaded the card flip package in the terminal. But it seems we cant figure out were to put this command in the eas build prosses. Any tips ?

1 Like

There are a few ways you can do it. One way would be to do this in package.json:

"scripts": {
  "eas-build-pre-install": "npm config set legacy-peer-deps true"
1 Like

it worked and the build succeeded. Thank to the both of you, this one line of code was all it took :smiling_face: This problem is solved :white_check_mark:


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