【发布时间】: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