使用 npm React Native 设置

React Native setup with npm

我是 React Native 和 npm 的新手。我想为我的 iPhone 安装一个演示来试用 WebRTC。我想安装这个:https://github.com/oney/RCTWebRTCDemo

但是,我对设置的步骤很困惑,我期望的是执行以下步骤,但似乎没有成功。

  1. react-native init RCTWebRTCDemo --version 0.29.0
  2. npm 安装https://github.com/oney/RCTWebRTCDemo.git
  3. npm 启动
  4. 将 iPhone 设备连接到 Mac
  5. 打开iOSfolder/RCTWebRTCDemo.xcodeproj
  6. 运行 并在 Xcode
  7. 中构建

能否请您帮助正确的步骤?非常感谢。

首先,请确保您已通过 npm install -g react-native-cli.

安装了 React Native CLI

然后执行以下操作:

  1. git clone https://github.com/oney/RCTWebRTCDemo.git
  2. cd RCTWebRTCDemo
  3. npm install
  4. react-native run-iosreact-native run-android