This is my first time working with Node.js and I ran into this problem:
I have started a Node server through the plugin of an IDE. Unfortunately, I cannot use the ID
Press in cmd or bash : Ctrl + C
Multiplatform, stable, best solution:
use fkill to kill process which is taking your port:
fkill -f :8080
To install fkill use command: npm i -g fkill
The fastest way is
killall node
Works with Linux, OS X
If you are using Windows, follow this:
Open task manager, look for this process:
Then just right click and "End task" it.
That's it, now all the npm commands run form the start.
You can use lsof
get the process that has bound to the required port.
Unfortunately the flags seem to be different depending on system, but on Mac OS X you can run
lsof -Pi | grep LISTEN
For example, on my machine I get something like:
mongod 8662 jacob 6u IPv4 0x17ceae4e0970fbe9 0t0 TCP localhost:27017 (LISTEN)
mongod 8662 jacob 7u IPv4 0x17ceae4e0f9c24b1 0t0 TCP localhost:28017 (LISTEN)
memcached 8680 jacob 17u IPv4 0x17ceae4e0971f7d1 0t0 TCP *:11211 (LISTEN)
memcached 8680 jacob 18u IPv6 0x17ceae4e0bdf6479 0t0 TCP *:11211 (LISTEN)
mysqld 9394 jacob 10u IPv4 0x17ceae4e080c4001 0t0 TCP *:3306 (LISTEN)
redis-ser 75429 jacob 4u IPv4 0x17ceae4e1ba8ea59 0t0 TCP localhost:6379 (LISTEN)
The second number is the PID and the port they're listening to is on the right before "(LISTEN)". Find the rogue PID and kill -9 $PID
to terminate with extreme prejudice.
you can try
killall node
you can also try
killall nodejs