/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
若是官方的方式安裝不了,參考:http://www.javashuo.com/article/p-otcyofga-kd.htmlhtml
brew install node
brew install watchman
#淘寶 npx nrm use taobao #或 #官方源 npx nrm use npm
npm install -g yarn
npx react-native init 項目名稱
#npx react-native init 項目名稱 --version 0.63.3
cd AwesomeProject yarn ios #或者 yarn react-native run-ios
正常狀況下啓動模擬器能夠正常運行node
MyProject App.js app.json index.js ios package.json
2.修改app.json, 改爲本身的項目名稱react
{ "name": "MyProject", "displayName": "MyProject" }
3.修改package.json, name改爲本身的項目名稱, 指定項目版本,指定引用的React-Native版本,參考複製過來的東西,可是用下面這個幾個配置就能夠了ios
{ "name": "MyProject", "version": "1.0.0", "private": true, "scripts": { "start": "yarn react-native start" }, "dependencies": { "react-native": "^0.63.3" } }
source 'https://github.com/CocoaPods/Specs.git' require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' platform :ios ,'10.0' use_frameworks! target 'MyProject' do config = use_native_modules! use_react_native!(:path => config["reactNativePath"]) end