“react

编程入门 行业动态 更新时间:2024-10-28 17:24:36
本文介绍了“react-native run-ios"时端口 8081 已在使用中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

是的,我已经阅读了这篇文章,但仍然不知道如何让它发挥作用.反应原生- 端口 8081 已在使用,打包程序未运行或未正确运行命令/bin/sh 失败,退出代码 2

Yes i have read this but still don't know how to make it work. 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 已经在使用中".

Then hit this "port 8081 already in use".

阅读了 React 文档,facebook.github.io/react-native/docs/troubleshooting.html

Did read the react doc, 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"?

Where and which step should i run "react-native start --port=8088" ?

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

btw, i'm an average engineer, but if i cannot run the very 1st react-native sample in 2 hours, i just cannot see how it can fly, this is very annoying.

推荐答案

在 RN 0.55 中,您可以通过以下方式解决此问题:

In RN 0.55 you can fix this with:

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

本文发布于:2023-08-07 11:25:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1318829.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:react

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!