浏览文章
文章信息
Node报错:Error: listen EADDRINUSE
16674
1、解释EADDRINUSE
因该是:E ADDR IN USE
E->error
ADDR->address
IN->in
USE->use
译文:错误:地址已经被使用
其实是端口被占用了
2、解决
查找你之前使用的端口
lsof -i:{port}
kill {pid}
示例:
root@ip-172-31-17-91:/www/wwwroot/msg.havefunchats.com/test# lsof -i:80 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME nginx 482 www 31u IPv4 6275478 0t0 TCP *:http (LISTEN) nginx 483 www 31u IPv4 6275478 0t0 TCP *:http (LISTEN) nginx 484 www 31u IPv4 6275478 0t0 TCP *:http (LISTEN) nginx 485 www 31u IPv4 6275478 0t0 TCP *:http (LISTEN) outline-s 1099 root 246u IPv4 8816582 0t0 TCP ip-172-31-17-91.ap-east-1.compute.internal:47608->111.206.37.189:http (FIN_WAIT1) nginx 19977 root 31u IPv4 6275478 0t0 TCP *:http (LISTEN) root@ip-172-31-17-91:/www/wwwroot/msg.havefunchats.com/test# kill 482 root@ip-172-31-17-91:/www/wwwroot/msg.havefunchats.com/test#