是否有必要在 windows 上为“react-native init AwesomeProject"安装用于 react-native 的 Python?
我正在尝试在 windows7 上设置 react-native.
I am trying to setup react-native on windows7.
我安装了以下东西:
C:\Windows\system32>node -v
v6.2.0
C:\Windows\system32>npm -v
3.8.9
C:\Windows\system32>javac -version
javac 1.8.0_60
我还没有安装 Python.当我尝试 react-native init AwesomeProject
时,AwesomeProject 中只下载了 2 个东西:node_modules dir 和
I have not installed Python. When i try react-native init AwesomeProject
only 2 things are downloaded in AwesomeProject: node_modules dir and
package.json
{
"name": "AwesomeProject",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"react-native": "0.41.2"
}
}
这是一个不完整的项目.ReactNative0.41 文档说
It is incomplete project. ReactNative0.41 Docs says
我们建议安装 Node.js 和 Python2.
We recommend installing Node.js and Python2.
为什么推荐 Python 与 react-native 一起使用?react-native 需要python来克隆种子项目吗?
Why Python is recommended with react-native? Does react-native requires python to clone the seed project?
我还安装了以下东西:
- Android SDK
- Android SDK 平台
- 安卓虚拟设备
- Android 6.0 SDK 工具
- Google API
- 英特尔 x86 Atom 系统映像
- 英特尔 x86 Atom_64 系统映像
- Google API 英特尔 x86 Atom_64 系统映像
是的,需要 Python.下载最新的 Python 2 版本并安装.
Yes, Python is needed. Download the newest Python 2 release and install it.
之所以使用它,是因为 React Native 的构建系统是 100% 基于它的.它用于编译您的源代码并在开发模式下提供它.就像某些构建系统基于 JS 使用 Webpack 一样,它们只是 Python 脚本的集合.
The reason why it's used is because React Native's build system is 100% based on it. It is used to compile your source code and serve it during development mode. In the same way that some build systems are based in JS using, say, Webpack, theirs is just a collection of Python scripts.
总的来说,Facebook 在构建工作流方面非常依赖 Python.
Facebook, in general, relies on Python a lot for build workflows.