reactjsreact-nativeexpoeas

Expo EAS build failure cannot load such file -- colored2


I am getting the following error when attempting to build the iOS version of my expo app using eas build -p ios --local:

[INSTALL_PODS] [!] Invalid `Podfile` file: cannot load such file -- colored2.
[INSTALL_PODS]  #  from /private/var/folders/yr/7xc177dn2cz107wsvzg573_m0000gn/T/eas-build-local-nodejs/c132d044-2136-499b-9471-1b0e11438b09/build/React/ios/Podfile:1
[INSTALL_PODS]  #  -------------------------------------------
[INSTALL_PODS]  >  require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
[INSTALL_PODS]  #  require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
[INSTALL_PODS]  #  -------------------------------------------

This app runs locally just fine in ExpoGo but fails with the eas build both in the cloud and locally.

This issue began after running expo upgrade to update my project to expo v47.

I did a global search on my project (including node_modules folder) and didn't find any references to colored2

When I run expo doctor this is the output:

Expected package @expo/config-plugins@^5.0.2
Found invalid:
  @expo/config-plugins@5.0.1
  @expo/config-plugins@4.1.5
    (for more info, run: npm why @expo/config-plugins)
Expected package @expo/prebuild-config@^5.0.5
Found invalid:
  @expo/prebuild-config@5.0.3
    (for more info, run: npm why @expo/prebuild-config)

Solution

  • I was able to fix this by upgrading cocoapods on my computer by running brew install cocoapods. I then closed out of the terminal I was using and opened a new one.

    This post helped me understand the issue