Is it necessary to install Python for react-native on windows for “react-native init AwesomeProject”?

坚强是说给别人听的谎言 提交于 2020-01-14 07:42:08

问题


I am trying to setup react-native on windows7.

I have following things installed:

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

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"
  }
}

It is incomplete project. ReactNative0.41 Docs says

We recommend installing Node.js and Python2.

Why Python is recommended with react-native? Does react-native requires python to clone the seed project?

I have installed following things as well:

  • Android SDK
  • Android SDK Platform
  • Android Virtual Device
  • Android 6.0 SDK tools
  • Google APIs
  • Intel x86 Atom System Image
  • Intel x86 Atom_64 System Image
  • Google APIs Intel x86 Atom_64 System Image

回答1:


Yes, Python is needed. Download the newest Python 2 release and install it.

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, in general, relies on Python a lot for build workflows.



来源:https://stackoverflow.com/questions/42442732/is-it-necessary-to-install-python-for-react-native-on-windows-for-react-native

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!