排坑指南 Troubleshooting

Integration with Existing Apps

执行yarn start之后出错,显示8081端口被占用

error listen EADDRINUSE: address already in use :::8081. Run CLI with --verbose flag for more details.
Error: listen EADDRINUSE: address already in use :::8081
    at Server.setupListenHandle [as _listen2] (net.js:1313:16)
    at listenInCluster (net.js:1361:12)
    at Server.listen (net.js:1447:7)
    at /Users/anql/lab/RNIntegratedApp/node_modules/metro/src/index.js:235:20
    at new Promise (<anonymous>)
    at Object.<anonymous> (/Users/anql/lab/RNIntegratedApp/node_modules/metro/src/index.js:234:14)
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/anql/lab/RNIntegratedApp/node_modules/metro/src/index.js:46:24)
    at _next (/Users/anql/lab/RNIntegratedApp/node_modules/metro/src/index.js:66:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

解决办法 :

yarn start --port 8088
adb reverse tcp:8081 tcp:8088

参考:

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。