编辑:修复 问题是McAfee(防病毒)默认阻止端口8081。我在此之后解决了这个问题:https://github.com/facebook/react-native/issues/10715
基本上,编辑文件:react-native / local-cli / server / server.js。
注意:react-native start --port 8088不起作用,因为我需要在运行react-native run-android的设备上启动应用程序,这会在端口8081上打开一个新的React Packager ... < / p>
贝娄是值得参考的问题。
我已安装react-packager并尝试运行&#34; AwesomeProject&#34;演示应用。
之后&gt; npm install,我尝试调用&gt;反应原生的开始。打包机正常运行......但无法访问网址&#34; localhost:8081&#34;从我的浏览器。我做错了什么?
详细信息:
react-native start
C:\xxx\zzz\yyy\workspace\front_reactnative>react-native start
(node:9640) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() inste
ad.
Scanning 617 folders for symlinks in C:\xxx\zzz\yyy\workspace\front_
reactnative\node_modules (35ms)
┌────────────────────────────────────────────────────────────────────────────┐
│ Running packager on port 8081. │
│ │
│ Keep this packager running while developing on any JS projects. Feel │
│ free to close this tab and run your own packager instance if you │
│ prefer. │
│ │
│ https://github.com/facebook/react-native │
│ │
└────────────────────────────────────────────────────────────────────────────┘
Looking for JS files in
C:\zzz\yyy\xxx\workspace\front_reactnative
[12:34:09] <START> Building Dependency Graph
[12:34:09] <START> Crawling File System
[Hot Module Replacement] Server listening on /hot
React packager ready.
本地主机:8081 (或)http://10.0.1.1:8081/
&#34;此页面不可用&#34;