无法`pod install`+ M1(Rosetta)[React Native Setup]

发布于 2025-02-02 18:54:27 字数 2069 浏览 1 评论 0原文

我正在Mac M1中设置一个React Native项目,当我尝试使用React-Navigation

 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 ..).

,我会收到此错误,当我尝试运行时,

cd ios && pod install 

我会读取多个线程并尝试安装> brewruby​​使用rosetta终端,我仍然会遇到相同的错误。

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'```

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'```

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文