1

I am setting up a react native project in my Mac M1 and when I try to use react-navigation I get this error,

 ERROR  [react-native-gesture-handler] react-native-gesture-handler module was not found. Make sure you're running your app on the native platform and your code is linked properly (cd ios && pod install && cd ..).

and when I tried running,

cd ios && pod install 

I read through multiple threads and tried installing brew and ruby using the rosetta terminal and I still get the same error.

arch -x86_64 pod install                                                                           14:12:19

[!] Invalid `Podfile` file: /Users/akilesh/Documents/akilesh/personal/learning/zippy/node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb:39: syntax error, unexpected <<
    template =<<~EOS
                ^
/Users/akilesh/Documents/akilesh/personal/learning/zippy/node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb:40: unknown regexp options - ll
/Users/akilesh/Documents/akilesh/personal/learning/zippy/node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb:41: dynamic constant assignment
        RCT_SCRIPT_POD_INSTALLATION_ROOT=$(pwd)
                                         ^
/Users/akilesh/Documents/akilesh/personal/learning/zippy/node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb:41: `$(' is not allowed as a global variable name
/Users/akilesh/Documents/akilesh/personal/learning/zippy/node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb:41: syntax error, unexpected end-of-input
        RCT_SCRIPT_POD_INSTALLATION_ROOT=$(pwd)
                                          ^.

 #  from /Users/akilesh/Documents/akilesh/personal/learning/zippy/ios/Podfile:1
 #  -------------------------------------------
 >  require_relative '../node_modules/react-native/scripts/react_native_pods'
 #  require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'```

akilesh raj
  • 656
  • 1
  • 8
  • 19

0 Answers0