我正在尝试在我的手机中构建和运行 react 本机应用程序。我尝试 使用入门,它工作正常。我执行以下操作
cd AwesomeProject
react-native start
在终端中打开一个新选项卡
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
react-native run-android
它在我的安卓手机中运行。
现在我正在尝试 从 GitHub 运行一个项目,我做了以下
git clone https://github.com/h87kg/NavigatorDemo.git
cd NavigatorDemo
react-native start
我得到 Command 'start' unrecognized. Did you mean to run this inside a react-native project?
错误。我应该怎么做才能运行这个项目?任何帮助表示赞赏。提前致谢。
更新
安装依赖项后 npm install
我能够运行服务器。现在,当我尝试运行 react-native run-android
我收到以下错误
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Could not install the app on the device, see the error above.
原文由 Saahithyan Vigneswaran 发布,翻译遵循 CC BY-SA 4.0 许可协议
你安装 节点模块 了吗?试试
npm install
git clone https://github.com/h87kg/NavigatorDemo.git
cd NavigatorDemo
npm install
react-native start