25

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

4

2 回答 2

96

ps aux除了 from 之外,您的输出中没有包含关键字“node”的其他进程grep node。您试图杀死节点的grep进程,并且没有节点进程正在运行,这就是它失败的原因。

尝试

sudo killall node

或者

sudo kill -9 `ps aux | grep node | grep -v grep | awk '{print $2}'`
于 2013-11-14T02:08:05.363 回答
0

你可以试试这个:

killall -s KILL node 
于 2021-09-27T00:22:32.030 回答