gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-05 00:14:24 25 4
gpt4 key购买 nike

是的,我已经阅读了这篇文章,但仍然不知道如何使它工作。
react native - Port 8081 already in use, packager is either not running or not running correctly Command /bin/sh failed with exit code 2

原来我是这样做的

1. react-native init Hello
2. react-native run-ios

然后点击这个“端口 8081 已经在使用中”。

阅读了 React 文档, 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.

我应该在哪里运行“react-native start --port=8088”?

顺便说一句,我是一个普通的工程师,但是如果我不能在 2 小时内运行第一个 react-native 样本,我就是看不到它是如何飞行的,这很烦人。

最佳答案

在 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

关于react-native - "react-native run-ios"时端口 8081 已在使用中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46923201/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com