我正在尝试运行节点应用程序。我跑node app.js。当我这样做时,我收到此错误:
node:events:346
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use :::5000
at Server.setupListenHandle [as _listen2] (node:net:1311:16)
at listenInCluster (node:net:1359:12)
at Server.listen (node:net:1446:7)
Emitted 'error' event on Server instance at:
at emitErrorNT (node:net:1338:8)
at processTicksAndRejections (node:internal/process/task_queues:81:21) {
code: 'EADDRINUSE',
errno: -48,
syscall: 'listen',
address: '::',
port: 5000
}
Run Code Online (Sandbox Code Playgroud)
我花了几个小时在网上寻找可能的解决方案,但到目前为止没有一个有效。相同的代码库在不同的机器上工作得很好。此错误发生在 Mac M1 芯片上。
有人知道如何解决这个问题吗?
我试图找到在 5000 上运行的进程,我试图杀死它们等等......到目前为止没有任何效果。我正在运行节点15.14.0。
我正在M1 Chip运行macOS Monterey
我该如何修复这个错误?
Fat*_*lut 51
您应该在 Mac 上禁用 AirPlay。因为macOS Monterey开始监听5000和8000端口。
系统偏好设置 > 共享 > 取消勾选 AirPlay 接收器
对于macOS 文图拉:
系统设置 > 常规 > 禁用 Airplay 接收器
李正贤说得对。永远无法工作的原因kill -9 PID是这样的:
https://developer.apple.com/forums/thread/682332
蒙特利的控制中心也在 5000 上监听。
我更改了 Nodejs 应用程序中的端口号,该应用程序再次开始工作。
| 归档时间: |
|
| 查看次数: |
14028 次 |
| 最近记录: |