how to release localhost from Error: listen EADDRINUSE

前端 未结 28 2185
孤独总比滥情好
孤独总比滥情好 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:34

    Error: listen EADDRINUSE to solve it in Ubuntu run in terminal netstat -nptl and after this kill -9 {process-number} this command is to kill node process and now you can try to run again node server.js command

    Ex

    listen EADDRINUSE :::8080

    netstat -nptl

    tcp6 0 0 :::9000 :::* LISTEN 9660/java
    tcp6 0 0 :::5800 :::* LISTEN -
    tcp6 0 0 :::5900 :::* LISTEN -
    tcp6 0 0 :::8080 :::* LISTEN 10401/node
    tcp6 0 0 :::20080 :::* LISTEN 9660/java
    tcp6 0 0 :::80 :::* LISTEN -
    tcp6 0 0 :::22 :::* LISTEN -
    tcp6 0 0 :::10137 :::* LISTEN 9660/java

    kill -9 10401

提交回复
热议问题