Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

try to kill all nodes but failed on osx

Tags:

I hope to restart nodejs on mac osx

$ps aux | grep node
mymac      20215   0.0  0.0  2432768    460 s000  R+    9:49AM   0:00.00 grep node

there is one PID 20215, I try to kill the process

kill -2 20215

it reports

-bash: kill: (20215) - No such process

your comment welcome

like image 444
arachide Avatar asked Nov 14 '13 01:11

arachide


People also ask

How do I kill all instances of node?

process. exit() in your application causes the NodeJS instance to close. killall node in bash would kill all NodeJS instances running on your machine.


1 Answers

There's no other process containing the keyword "node" in your ps aux output except from grep node. You're trying to kill the process of greping node, and no node process is running, that's why it fails.

Try with

sudo killall node

Or

sudo kill -9 `ps aux | grep node | grep -v grep | awk '{print $2}'`
like image 145
jlhonora Avatar answered Oct 11 '22 04:10

jlhonora