端口8081在"react-native run-ios"中已经在使用

use*_*178 4 react-native

是的,我已经读过这个,但仍然不知道如何使它工作. 本机响应 - 端口8081已在使用中,打包器未运行或未正常运行Command/bin/sh失败,退出代码为2

最初我是这样做的

1. react-native init Hello
2. react-native run-ios
Run Code Online (Sandbox Code Playgroud)

然后点击"已使用的端口8081".

读过反应文档,https://facebook.github.io/react-native/docs/troubleshooting.html

1. cannot kill the process using 8081, it keeps on coming back,
   and i don't want to kill it
2. react-native start --port=8088
3. update node_modules/react-
native/React/React.xcodeproj/project.pbxproj file. Did it.
Run Code Online (Sandbox Code Playgroud)

应该在哪里和哪一步运行"react-native start --port = 8088"?

顺便说一句,我是一名普通的工程师,但如果我不能在2小时内运行第一反应本机样本,我就看不出它是如何飞行的,这非常烦人.

jco*_*lum 6

在RN 0.55中,你可以解决这个问题:

react-native start --port=1234

然后在另一个窗口:

react-native run-ios --port 1234

版本:

? react-native --version
react-native-cli: 2.0.1
react-native: 0.55.4
Run Code Online (Sandbox Code Playgroud)

  • 实际上,不需要`react-native start --port = 1234`。``react-native run-ios --port 1234''就足够了。 (2认同)