How to fix Error: listen EADDRINUSE while using nodejs?

前端 未结 30 3755
执念已碎
执念已碎 2020-11-22 06:44

If I run a server with the port 80, and I try to use xmlHTTPrequest i get this error: Error: listen EADDRINUSE

Why is it problem for nodejs, if I want t

30条回答
  •  耶瑟儿~
    2020-11-22 06:58

    Error: listen EADDRINUSE means the port which you want to assign/bind to your application server is already in use. You can either assign another port to your application.

    Or if you want to assign the same port to the app. Then kill the application that is running at your desired port.

    For a node application what you can try is, find the process id for the node app by :

    ps -aux | grep node
    

    After getting the process id, do

    kill process_id
    

提交回复
热议问题