In-depth introduction to React Native: Environment configuration, reactnative
This tutorial mainly describes how to use react native to develop iOS. Therefore, you need a mac. Of course, black apple is also acceptable ~
To create a react native project, you only need to install the following five components ~~ (However, if FQ is not used, the installation will slow down to a dog)
1. Install xcode
Anyone who has done ios-related development knows this. As the Chief IDE of ios development, you can search and download from the Apple Store directly.
2.InstallBrew
Brew also needs Homebrew. What is it? The official website explains:
Homebrew INSTALLThe suff you need the Apple didn't. (To put it simply, it can help you install and uninstall some components more easily and make your MAC better ~)
The installation method is simple. You only need a ruby command. (Ruby has been installed by default in the MAC system, so we will not introduce it here .)
Open the console and enter the following command. After the command is generated, you only need to wait ~
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
3.InstallNode. js
Install Version 4.0 or later.
In step 3, we have installed brew. We can use it to install node. js ~ Of course, you can also download and install it directly on the node. js website.
Enter
brew install node
4.InstallWatchman
Watchman is used to monitor files and record file changes. When a file changes, it can trigger some operations, such as executing some commands ~
Enter
brew install watchman
5. Install react native command line tool
Enter
npm install -g react-native-cli
If an error is reported, that is, permission denied, enter
sudo npm install -g react-native-cli
The above are only basic components and will be added later ~