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
ps -ef |grep node find app.js , kill pid of app.js
I have node red installed on my Mac and my Raspberry Pi. Had the exact same problem and doing 'killall' didn't help. Once I shut down the Raspberry Pi and restarted my computer it worked fine.
To kill node server first run this command in your terminal :
top
id
from the previous window: PID number -9 kill
so now you killed your node server try again to run your app.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 <pid>
in the above case sudo kill -9 11716
Run:
ps -ax | grep node
You'll get something like:
60778 ?? 0:00.62 /usr/local/bin/node abc.js
Then do:
kill -9 60778
use below command to kill a process running at a certain port - 3000 in this example below
kill -9 $(lsof -t -i:3000)