I´am on a windows machine, and I understand that it is a little different here.
我´windows机器上,我明白,这里有点不同。
The problem is that I can't find any information on how I stop, kill or exit nodemon.
问题是我找不到任何关于我如何停止,杀死或退出nodemon的信息。
3 个解决方案
#1
8
For purposes of completeness, The correct answer is press Ctrl + C. Or you could also find it in task manager and kill it. This applies to pretty much anything on the command line.
出于完整性的考虑,正确的答案是按Ctrl + c,或者您也可以在task manager中找到并删除它。这几乎适用于命令行上的任何内容。
#2
14
My experience here is that Ctrl+C leaves a node instance running in the background. If you want to kill the stack, when you try to restart 'nodemon server.js' or just 'node server.js' for that matter, you will get an EADDRINUSE error because the old node server has the port tied up. You have to find it by using ps -W | grep node
in the terminal window, because the task manager wont show it. Also you can kill it with the process ID (PID) with taskkill. The /F is the 'force' parameter. Here we will kill the task with PID 7528.
我的经验是,Ctrl+C会在后台运行一个节点实例。如果您想要杀死堆栈,当您试图重新启动“nodemon”服务器时。或者仅仅是节点服务器。对于这个问题,您将会得到一个EADDRINUSE错误,因为旧的节点服务器将端口绑定在一起。您必须通过在终端窗口中使用ps -W | grep节点找到它,因为任务管理器不会显示它。您还可以使用进程ID (PID)和taskkill来杀死它。F是“力”参数。在这里,我们将使用PID 7528完成任务。
$ taskkill /F /PID 7528
Then check ps -W | grep node again, and the node server should be gone, and the server will launch again.
然后再次检查ps -W | grep节点,节点服务器应该消失,服务器将再次启动。
Their docs show a few tricks on intercepting the shutdown command, but since they use a 'rs' command to restart, they could add a 'kill' command to shutdown the daemon.
他们的文档展示了一些拦截关闭命令的技巧,但是由于他们使用“rs”命令重新启动,他们可以添加“kill”命令来关闭守护进程。
Brian
布莱恩
#3
1
I used git bash on window and I couldn't terminate the nodemon process with ctr
+ c
, so I would terminate the node process on the task manager to use the same port. Later I found on github to why nodemon
doesn't terminate in git bash
. Anywaypowershell
should be use instead, after ctr
+ c
it will ask either to terminate batch job or not. This action will clear the process and stop nodemon.
我在窗口上使用了git bash,并且不能使用ctr + c终止nodemon进程,因此我将终止任务管理器上的节点进程以使用相同的端口。后来我在github上发现了为什么nodemon不能在git bash中终止。不管怎样,powershell应该被使用,在ctr + c之后,它将要求终止批处理作业或不终止批处理作业。此操作将清除进程并停止nodemon。
#1
8
For purposes of completeness, The correct answer is press Ctrl + C. Or you could also find it in task manager and kill it. This applies to pretty much anything on the command line.
出于完整性的考虑,正确的答案是按Ctrl + c,或者您也可以在task manager中找到并删除它。这几乎适用于命令行上的任何内容。
#2
14
My experience here is that Ctrl+C leaves a node instance running in the background. If you want to kill the stack, when you try to restart 'nodemon server.js' or just 'node server.js' for that matter, you will get an EADDRINUSE error because the old node server has the port tied up. You have to find it by using ps -W | grep node
in the terminal window, because the task manager wont show it. Also you can kill it with the process ID (PID) with taskkill. The /F is the 'force' parameter. Here we will kill the task with PID 7528.
我的经验是,Ctrl+C会在后台运行一个节点实例。如果您想要杀死堆栈,当您试图重新启动“nodemon”服务器时。或者仅仅是节点服务器。对于这个问题,您将会得到一个EADDRINUSE错误,因为旧的节点服务器将端口绑定在一起。您必须通过在终端窗口中使用ps -W | grep节点找到它,因为任务管理器不会显示它。您还可以使用进程ID (PID)和taskkill来杀死它。F是“力”参数。在这里,我们将使用PID 7528完成任务。
$ taskkill /F /PID 7528
Then check ps -W | grep node again, and the node server should be gone, and the server will launch again.
然后再次检查ps -W | grep节点,节点服务器应该消失,服务器将再次启动。
Their docs show a few tricks on intercepting the shutdown command, but since they use a 'rs' command to restart, they could add a 'kill' command to shutdown the daemon.
他们的文档展示了一些拦截关闭命令的技巧,但是由于他们使用“rs”命令重新启动,他们可以添加“kill”命令来关闭守护进程。
Brian
布莱恩
#3
1
I used git bash on window and I couldn't terminate the nodemon process with ctr
+ c
, so I would terminate the node process on the task manager to use the same port. Later I found on github to why nodemon
doesn't terminate in git bash
. Anywaypowershell
should be use instead, after ctr
+ c
it will ask either to terminate batch job or not. This action will clear the process and stop nodemon.
我在窗口上使用了git bash,并且不能使用ctr + c终止nodemon进程,因此我将终止任务管理器上的节点进程以使用相同的端口。后来我在github上发现了为什么nodemon不能在git bash中终止。不管怎样,powershell应该被使用,在ctr + c之后,它将要求终止批处理作业或不终止批处理作业。此操作将清除进程并停止nodemon。