【问题标题】:React-navigation-The term 'pod' is not recognized as the name of a cmdletReact-navigation - 术语“pod”未被识别为 cmdlet 的名称
【发布时间】:2020-02-09 10:54:25
【问题描述】:

我的操作系统 (OS) 是 windows 10。我使用以下代码创建了一个 React-Native 项目:

react-native init AwesomeProject

我想安装 React-navigation 然后执行以下步骤:(based on the React-Navigation documentation)

1-

npm install @react-navigation/native

2-

npm install 
react-native-reanimated 
react-native-gesture-handler 
react-native-screens 
react-native-safe-area-context 
@react-native-community/masked-view

3- 当我运行以下步骤时出现错误:

cd ios
pod install
cd ..

pod : 术语“pod”未被识别为 cmdlet 的名称, 函数、脚本文件或可运行的程序。检查拼写 名称,或者如果包含路径,请验证路径是否正确并 再试一次。

我不知道如何在windows中运行上面的命令。

编辑:

我的 package.json

{
  "name": "testproject",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-community/masked-view": "^0.1.6",
    "@react-navigation/native": "^5.0.0",
    "@react-navigation/stack": "^5.0.0",
    "react": "16.9.0",
    "react-native": "0.61.5",
    "react-native-gesture-handler": "^1.5.6",
    "react-native-reanimated": "^1.7.0",
    "react-native-safe-area-context": "^0.7.2",
    "react-native-screens": "^2.0.0-beta.2"
  },
  "devDependencies": {
    "@babel/core": "7.8.4",
    "@babel/runtime": "7.8.4",
    "@react-native-community/eslint-config": "0.0.5",
    "babel-jest": "24.9.0",
    "eslint": "6.8.0",
    "jest": "24.9.0",
    "metro-react-native-babel-preset": "0.56.4",
    "react-test-renderer": "16.9.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

【问题讨论】:

    标签: react-native react-navigation react-native-ios react-native-navigation


    【解决方案1】:

    pod install 命令用于开发只能在 Mac 上完成的 iOS 应用程序。

    由于您使用的是 Windows,因此您无法开发 iOS 应用。所以你可以完全跳过这一步。

    【讨论】:

      【解决方案2】:

      除非您在系统上安装 cocoa pod,否则它将无法工作。使用安装可可豆荚 “sudo gem install cocoapods”这个命令。关注https://guides.cocoapods.org/using/getting-started.html以获得进一步的指导。 pod 也将被安装,并且仅适用于 MacOS 而不是 Windows 操作系统。

      【讨论】:

      • 我想知道这是否是问题的答案。您说它在 Windows 操作系统中不起作用,那么这怎么可能是答案?
      猜你喜欢
      • 2019-10-12
      • 2017-12-11
      • 2021-12-09
      • 2020-02-25
      • 2020-04-17
      • 2018-09-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多