我有一个nodejs应用程序,我可以配置https并在我的windows机器上本地运行它,但是当我在我的Linux机器上执行同样的操作时,它会失败,并出现以下错误。
events.js:282
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use 0.0.0.0:3006
at Server.setupListenHandle [as _listen2] (net.js:1308:16)
at listenInCluster (net.js:1356:12)
at doListen (net.js:1495:7)
at processTicksAndRejections (internal/process/task_queues.js:85:21)
Emitted 'error' event on Server instance at:
at emitErrorNT (net.js:1335:8)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'EADDRINUSE',
errno: -98,
syscall: 'listen',
address: '0.0.0.0',
port: 3006
}
根据其他人的建议,我尝试了“netstat-plnt”,但是端口
没人用,所以没什么好杀的。
[更新]将端口更改为3006
netstat -plnt
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN -
tcp6 0 0 :::111 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -