how to release localhost from Error: listen EADDRINUSE

前端 未结 28 2207
孤独总比滥情好
孤独总比滥情好 2020-11-28 17:53

i am testing a server written in nodejs on windows 7 and when i try to run the tester in the command line i get the following error

Error: listen EADDRINUSE
         


        
28条回答
  •  天命终不由人
    2020-11-28 18:28

    suppose your server is running on port 3000

    lsof -i tcp:3000
        COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
        node    11716 arun   11u  IPv6 159175      0t0  TCP *:3000 (LISTEN)
    

    after that use kill -9

    in the above case sudo kill -9 11716

提交回复
热议问题