File tree Expand file tree Collapse file tree 3 files changed +31
-9
lines changed
website/src/pages/docs/environment-setup Expand file tree Collapse file tree 3 files changed +31
-9
lines changed Original file line number Diff line number Diff line change @@ -11,18 +11,18 @@ Android 环境安装(for Windows)
1111
1212### ` Node, Python2, JDK `
1313
14- 我们建议通过 [ ` Chocolatey ` ] ( https://chocolatey.org/ ) (一种流行的 Windows 包管理器)安装 ` Node ` 和 ` Python2 ` 。
14+ 我们建议通过 [ ` Chocolatey ` ] ( https://chocolatey.org/ ) (一种流行的 Windows 包管理器)安装 ` Node ` ~~ 和 ` Python2 ` ~~ 。
1515
16- React Native 还需要 [ Java SE Development Kit ( JDK) ] ( https://openjdk.java.net/projects/jdk8/ ) 以及 ` Python2 ` 。 两者都可以使用 Chocolatey 安装。
16+ React Native 还需要 [ Java Development Kit [ JDK] 11 ] ( https://www.oracle.com/java/technologies/downloads/#java11 ) ~~ 以及 ` Python2 ` ~~ 。 两者都可以使用 Chocolatey 安装。
1717
1818打开管理员命令提示符(右键单击命令提示符并选择“以管理员身份运行”),然后运行以下命令:
1919
2020``` shell
21- choco install -y nodejs.install python2 openjdk8
21+ choco install -y nodejs.install openjdk11
2222```
2323
24- > 🚧 如果您的系统上已经安装了 Node,请确保它是 Node 10 或更新版本。 如果您的系统上已经有 JDK,请确保它是版本 8 或更高版本。
25- > 您可以在 Node 的 [ 下载页面 ] ( https://nodejs.org/en/download/ ) 上找到其他安装选项 。
24+ > 🚧 如果您的系统上已经安装了 Node,请确保它是 Node 14 或更新版本。(您可以在 Node 的 [ 下载页面 ] ( https://nodejs.org/en/download/ ) 上找到其他安装选项。)
25+ > 🚧 低于 0.67 版本的 React Native 需要 JDK 1.8 版本(官方也称 8 版本) 。
2626 <!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px;-->
2727
2828> 🚧 在键盘按下 <kbd >win</kbd > + <kbd >R</kbd > 键,输入 ` cmd ` ,然后回车,打开 ` cmd ` 窗口
Original file line number Diff line number Diff line change @@ -29,10 +29,12 @@ brew install watchman
2929我们建议使用 [ Homebrew] ( http://brew.sh/ ) 安装 JDK。 安装 Homebrew 后,在终端中运行以下命令:
3030
3131``` shell
32- brew install --cask adoptopenjdk/openjdk/adoptopenjdk8
32+ brew tap homebrew/cask-versions
33+ brew install --cask zulu11
3334```
35+ React Native 需要 Java Development Kit [ JDK] 11。你可以在命令行中输入 javac -version(请注意是 javac,不是 java)来查看你当前安装的 JDK 版本。
3436
35- > 🚧 如果您的系统上已经安装了 JDK,请确保它是 JDK 8 或更新版本 。
37+ > 🚧 低于 0.67 版本的 React Native 需要 JDK 1.8 版本(官方也称 8 版本) 。
3638 <!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px; display: inline-block;-->
3739
3840### ` 安卓开发环境 `
Original file line number Diff line number Diff line change @@ -19,15 +19,24 @@ brew install node
1919brew install watchman
2020```
2121
22- 如果您的系统上已经安装了 Node,请确保它是 Node 12 或更新版本。
22+ 如果你已经安装了 Node,请检查其版本是否在 v14 以上。安装完 Node 后建议设置 npm 镜像(淘宝源)以加速后面的过程(或使用科学上网工具)。
23+ > 🚧 注意:不要使用 cnpm!cnpm 安装的模块路径比较奇怪,packager 不能正常识别!
24+ <!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px; display: inline-block;-->
25+ ``` shell
26+ # 使用nrm工具切换淘宝源
27+ npx nrm use taobao
28+
29+ # 如果之后需要切换回官方源可使用
30+ npx nrm use npm
31+ ```
2332
2433[ Watchman] ( https://facebook.github.io/watchman ) 是 Facebook 的一个工具,用于观察文件系统中的变化。 强烈建议您安装它以获得更好的性能。
2534
2635### ` Xcode `
2736
2837安装 Xcode 的最简单方法是通过 [ Mac App Store] ( https://itunes.apple.com/cn/app/xcode/id497799835?mt=12 ) 。 安装 Xcode 也将安装 iOS 模拟器和所有必要的工具来构建你的 iOS 应用程序。
2938
30- 如果您已经在系统上安装了 Xcode,请确保它是 10 版或更新版本。
39+ 如果您已经在系统上安装了 Xcode,请确保它是 12 版或更新版本。
3140
3241![ Xcode] ( ./001.png ) <!-- rehype:style=max-width: 480px;-->
3342
@@ -66,6 +75,17 @@ sudo gem install cocoapods -v 1.4.0
6675
6776有关更多信息,请访问 [ CocoaPods 入门指南] ( https://guides.cocoapods.org/using/getting-started.html ) 。
6877
78+ <details >
79+ <summary>Mac M1 的注意事项</summary>
80+ Cocoapods 目前在 Mac M1 架构上可能还有一些兼容问题(我们建议使用brew install cocoapods来安装 Cocoapods)。如果你在安装 pods 依赖时出现问题,可以尝试运行下面的命令:
81+
82+ - ` sudo arch -x86_64 gem install ffi `
83+ - ` arch -x86_64 pod install `
84+
85+ 以上命令会安装ffi包,用于在安装和装载 pods 时调用合适的系统架构。
86+
87+ </details >
88+
6989### ` React Native 命令行界面 `
7090
7191React Native 有一个内置的命令行界面。 我们建议您在运行时使用 Node.js 附带的 ` npx ` 访问当前版本,而不是全局安装和管理特定版本的 CLI。 使用 ` npx react-native <command> ` ,当前稳定版本的 CLI 将在命令运行时下载并执行。
You can’t perform that action at this time.
0 commit comments