我遇到这个问题已有一段时间了,我似乎找不到根本原因。我已经重新安装了node和npm(使用nvm),但不幸的是,我仍然面临着同样的问题。
当我在npm start
回购上运行create-react-app
时,我总是收到Something is already running on port <port>
,但实际上它似乎不是正在使用的端口。在这种情况下,端口为5056
。
通过以下问题运行sudo lsof -i -n -P | grep TCP
时:Who is listening on a given TCP port on Mac OS X?,我得到以下信息:
CrashPlan 48 root 71u IPv6 0x2c25a5583eff58c1 0t0 TCP 127.0.0.1:4244 (LISTEN)
CrashPlan 48 root 85u IPv6 0x2c25a5583eff3c01 0t0 TCP 127.0.0.1:4244->127.0.0.1:61721 (FIN_WAIT_2)
CrashPlan 48 root 86u IPv6 0x2c25a5583eff41c1 0t0 TCP 127.0.0.1:4244->127.0.0.1:53768 (ESTABLISHED)
vpnagentd 55 root 5u IPv4 0x2c25a5583d8b2181 0t0 TCP 127.0.0.1:29754 (LISTEN)
ciscod 58 root 3u IPv4 0x2c25a5583d8b2b01 0t0 TCP 127.0.0.1:1023 (LISTEN)
apsd 91 root 13u IPv4 0x2c25a55862e8cb01 0t0 TCP 9.240.44.255:60294->17.249.12.152:5223 (ESTABLISHED)
apsd 91 root 15u IPv4 0x2c25a55862e8cb01 0t0 TCP 9.240.44.255:60294->17.249.12.152:5223 (ESTABLISHED)
rapportd 462 myusername 3u IPv4 0x2c25a5586329f481 0t0 TCP *:60276 (LISTEN)
rapportd 462 myusername 4u IPv6 0x2c25a55861ba8301 0t0 TCP *:60276 (LISTEN)
identitys 466 myusername 32u IPv6 0x2c25a5583eff5301 0t0 TCP [fe80:c::992:b67a:e838:6f09]:1024->[fe80:c::d5c2:7935:1b0d:c90f]:1024 (ESTABLISHED)
identitys 466 myusername 33u IPv6 0x2c25a5583eff5301 0t0 TCP [fe80:c::992:b67a:e838:6f09]:1024->[fe80:c::d5c2:7935:1b0d:c90f]:1024 (ESTABLISHED)
identitys 466 myusername 34u IPv6 0x2c25a5583eff2ac1 0t0 TCP [fe80:c::992:b67a:e838:6f09]:1025->[fe80:c::d5c2:7935:1b0d:c90f]:9304 (ESTABLISHED)
identitys 466 myusername 35u IPv6 0x2c25a5583eff2ac1 0t0 TCP [fe80:c::992:b67a:e838:6f09]:1025->[fe80:c::d5c2:7935:1b0d:c90f]:9304 (ESTABLISHED)
expressvp 805 root 11u IPv4 0x2c25a55847c2d481 0t0 TCP 127.0.0.1:2015 (LISTEN)
expressvp 805 root 12u IPv4 0x2c25a5586031d481 0t0 TCP 9.240.44.255:61661->3.212.116.79:443 (CLOSE_WAIT)
expressvp 805 root 16u IPv4 0x2c25a55868fb3b01 0t0 TCP 9.240.44.255:61662->3.212.116.79:443 (CLOSE_WAIT)
CrashPlan 814 myusername 51u IPv4 0x2c25a5584b21c181 0t0 TCP 127.0.0.1:53768->127.0.0.1:4244 (ESTABLISHED)
CrashPlan 814 myusername 53u IPv4 0x2c25a558807adb01 0t0 TCP 127.0.0.1:61721->127.0.0.1:4244 (CLOSE_WAIT)
Postman 22459 myusername 59u IPv4 0x2c25a55862309801 0t0 TCP 9.240.44.255:60336->34.224.76.239:443 (CLOSED)
Postman 22459 myusername 73u IPv4 0x2c25a5586031c181 0t0 TCP 9.240.44.255:60337->34.224.76.239:443 (ESTABLISHED)
Discord 36658 myusername 59u IPv4 0x2c25a5583d8b0e81 0t0 TCP 9.240.44.255:60423->104.16.60.37:443 (ESTABLISHED)
Discord 36658 myusername 67u IPv4 0x2c25a558807ae481 0t0 TCP 9.240.44.255:61654->104.16.59.5:443 (ESTABLISHED)
Discord 36658 myusername 97u IPv4 0x2c25a55857e86181 0t0 TCP 9.240.44.255:60359->35.186.224.47:443 (ESTABLISHED)
Discord 36664 myusername 49u IPv4 0x2c25a5586ce46b01 0t0 TCP 127.0.0.1:6463 (LISTEN)
Slack 51840 myusername 73u IPv4 0x2c25a5586329ce81 0t0 TCP 9.240.44.255:60383->52.37.243.173:443 (ESTABLISHED)
Slack 51840 myusername 112u IPv4 0x2c25a5586329d801 0t0 TCP 9.240.44.255:60333->52.37.243.173:443 (ESTABLISHED)
Slack 51840 myusername 117u IPv4 0x2c25a55847c2ae81 0t0 TCP 9.240.44.255:60339->52.37.243.173:443 (ESTABLISHED)
Slack 51840 myusername 118u IPv4 0x2c25a5586914a181 0t0 TCP 9.240.44.255:60338->52.37.243.173:443 (ESTABLISHED)
Slack 51840 myusername 119u IPv4 0x2c25a55854de1481 0t0 TCP 9.240.44.255:60342->52.37.243.173:443 (ESTABLISHED)
firefox 76426 myusername 95u IPv4 0x2c25a55858abae81 0t0 TCP 9.240.44.255:60326->34.209.103.65:443 (ESTABLISHED)
firefox 76426 myusername 120u IPv4 0x2c25a55857e87481 0t0 TCP 9.240.44.255:60361->159.203.171.189:443 (ESTABLISHED)
Google 76844 myusername 30u IPv4 0x2c25a558807f0481 0t0 TCP 9.240.44.255:61632->104.16.28.34:443 (ESTABLISHED)
Google 76844 myusername 35u IPv4 0x2c25a558807c7481 0t0 TCP 9.240.44.255:60837->159.203.171.189:443 (ESTABLISHED)
Google 76844 myusername 36u IPv4 0x2c25a5588079a181 0t0 TCP 9.240.44.255:61218->192.30.253.125:443 (ESTABLISHED)
Google 76844 myusername 38u IPv4 0x2c25a5587a432481 0t0 TCP 9.240.44.255:61724->52.207.60.84:443 (ESTABLISHED)
Google 76844 myusername 41u IPv4 0x2c25a55880798e81 0t0 TCP 9.240.44.255:61728->192.184.69.195:443 (ESTABLISHED)
Google 76844 myusername 44u IPv4 0x2c25a5586167c801 0t0 TCP 9.240.44.255:61651->162.247.242.21:443 (ESTABLISHED)
Google 76844 myusername 46u IPv4 0x2c25a5583d8b1801 0t0 TCP 9.240.44.255:60305->165.160.13.20:80 (CLOSED)
Google 76844 myusername 50u IPv4 0x2c25a55863665481 0t0 TCP 9.240.44.255:61726->52.207.32.1:443 (ESTABLISHED)
Google 76844 myusername 60u IPv4 0x2c25a55868fb4481 0t0 TCP 9.240.44.255:60306->165.160.13.20:80 (CLOSED)
Google 76844 myusername 63u IPv4 0x2c25a55863662e81 0t0 TCP 9.240.44.255:60308->165.160.15.20:80 (ESTABLISHED)
Google 76844 myusername 64u IPv4 0x2c25a5586031ae81 0t0 TCP 9.240.44.255:60309->165.160.13.20:80 (ESTABLISHED)
Google 76844 myusername 66u IPv4 0x2c25a5586329eb01 0t0 TCP 9.240.44.255:60310->165.160.13.20:80 (ESTABLISHED)
Google 76844 myusername 69u IPv4 0x2c25a5586f554481 0t0 TCP 9.240.44.255:61646->23.222.172.234:443 (ESTABLISHED)
Google 76844 myusername 74u IPv4 0x2c25a5588085e481 0t0 TCP 9.240.44.255:61647->23.222.172.234:443 (ESTABLISHED)
Google 76844 myusername 77u IPv4 0x2c25a5588085be81 0t0 TCP 9.240.44.255:61706->198.252.206.25:443 (ESTABLISHED)
Google 76844 myusername 79u IPv4 0x2c25a558807c6b01 0t0 TCP 9.240.44.255:61729->198.252.206.25:443 (ESTABLISHED)
Google 76844 myusername 81u IPv4 0x2c25a558807c6181 0t0 TCP 9.240.44.255:61629->151.101.1.69:443 (ESTABLISHED)
Google 76844 myusername 85u IPv4 0x2c25a55880792b01 0t0 TCP 9.240.44.255:61712->198.252.206.25:443 (ESTABLISHED)
Google 76844 myusername 86u IPv4 0x2c25a558807d9481 0t0 TCP 9.240.44.255:61727->52.207.32.1:443 (ESTABLISHED)
Google 76844 myusername 93u IPv4 0x2c25a558807b1e81 0t0 TCP 9.240.44.255:61630->192.0.73.2:443 (ESTABLISHED)
Google 76844 myusername 100u IPv4 0x2c25a55863664181 0t0 TCP 9.240.44.255:61634->184.30.231.203:443 (ESTABLISHED)
Google 76844 myusername 114u IPv4 0x2c25a55880791801 0t0 TCP 9.240.44.255:61522->151.101.41.140:443 (ESTABLISHED)
Google 76844 myusername 123u IPv4 0x2c25a55853feab01 0t0 TCP 9.240.44.255:61544->104.244.42.200:443 (ESTABLISHED)
Google 76844 myusername 146u IPv4 0x2c25a5586172e181 0t0 TCP 9.240.44.255:61584->151.101.40.84:443 (ESTABLISHED)
Spotify 92621 myusername 69u IPv4 0x2c25a5588085db01 0t0 TCP *:61682 (LISTEN)
Spotify 92621 myusername 71u IPv4 0x2c25a55847c2b801 0t0 TCP *:57621 (LISTEN)
Spotify 92621 myusername 79u IPv4 0x2c25a5584b21b801 0t0 TCP 9.240.44.255:60556->104.199.65.177:4070 (ESTABLISHED)
Spotify 92621 myusername 112u IPv4 0x2c25a5586167d181 0t0 TCP 9.240.44.255:60562->35.186.224.53:443 (ESTABLISHED)
Spotify 92621 myusername 139u IPv4 0x2c25a55858abb801 0t0 TCP 9.240.44.255:60566->151.101.40.246:443 (CLOSED)
Spotify 92621 myusername 140u IPv4 0x2c25a55858abcb01 0t0 TCP 9.240.44.255:60567->151.101.40.246:443 (CLOSED)
Spotify 92621 myusername 141u IPv4 0x2c25a55858abd481 0t0 TCP 9.240.44.255:60568->151.101.40.246:443 (CLOSED)
我似乎找不到该端口的任何用途,并且我一直在努力寻找导致此问题的原因。如果我通过修改5056
文件将端口强行插入scripts/start.js
,它确实按预期加载,但是出现了代理请求问题,因此我的状态数据都不从模拟API加载。如果我选择在另一个端口上运行该应用程序,也是如此。
我收到一个ETIMEDOUT
错误,说它无法代理请求。
如果有人对导致问题的原因有任何想法,那么我将非常感激。值得一提的是,其他人也可以按预期运行相同的存储库,而不会遇到上述任何问题。
编辑:
运行lsof -i:5056
时不返回任何内容。
运行lsof -n -i4TCP:3000 | grep LISTEN
也不会返回任何内容。
运行最新的XCode更新似乎已解决了该问题...
答案 0 :(得分:-1)
这可能会有所帮助:http://johnharbison.net/something-is-already-running-on-port-3000-mac 检查您的本地主机是否在/ etc / hosts中正确配置。