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
When you get an error Error: listen EADDRINUSE,
Try running the following shell commands:
netstat -a -o | grep 8080
taskkill /F /PID 6204
I grep
ed for 8080, because I know my server is running on port 8080. (static
tells me when I start it: 'serving "." at http://127.0.0.1:8080'.) You might have to search for a different port.
Check the Process ID
sudo lsof -i:8081
Than kill the particular Process
sudo kill -9 2925
You are getting the error EADDRINUSE
because the port, which your application wants to use, is occupied by another process. To release this port, you need to terminate the occupying process.
Since you are on Windows, you can terminate the process using the command prompt (cmd
). With the cmd
you can discover the process ID (PID) of the blocking application. You will need the PID in order to terminate / kill the process.
Here is a step-by-step guide...
Find all processes which are running on a specified port (in this example, Port is "3000"):
netstat -ano | find ":3000 "
The netstat
command will list up all processes running on the specified port. In the last column of the netstat
results you can see the PID
s (in this example, PID is "8308"). You can find out more about a specific PID
by running the following command:
tasklist /fi "pid eq 8308"
If you want to terminate a process, you can do that with the following command by using its PID
(in this example, PID is "8308"):
taskkill /pid 8308 /f
Screenshot
It means the address you are trying to bind the server to is in use. Try another port or close the program using that port.
You will need to kill the port by trying to use the following command on the terminal
$ sudo killall -9 nodejs
When you get an error
Error: listen EADDRINUSE
Open command prompt and type the following instructions:
netstat -a -o | grep 8080
taskkill /F /PID** <*ur Process ID no*>
after that restart phone gap interface.
If you want to know which process ID phonegap is using, open TASK MANAGER and look at the Column heading PID and find the PID no.