【发布时间】:2017-01-28 02:17:23
【问题描述】:
我正在尝试在我的手机中构建和运行 react 本机应用程序。我试过Getting Started,它工作正常。我执行以下操作来运行
cd AwesomeProjectreact-native start- 在终端中打开一个新标签
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"react-native run-android
它在我的安卓手机中运行。
现在我正在尝试运行project from GitHub,我做了以下操作
git clone https://github.com/h87kg/NavigatorDemo.gitcd NavigatorDemoreact-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.
【问题讨论】:
-
不是答案,但我真的从未使用过
start命令。在 cd 进入项目目录后,我只做 react-native run-android 或 run-ios :S 。哦,是的,如果它的其他项目通常你也必须先npm install依赖项。 -
是的,如果
start自动启动,我们不需要运行它,是的,我已经更新了问题 -
@Saahityan ,不确定它叫什么,但在运行新项目之前关闭任何“其他”现有的反应打包程序终端。
-
@cjmling,我该如何停止,命令是什么或者你的意思是
ctrl+c -
我通常只是简单地关闭 GUI 屏幕。
标签: reactjs react-native react-router