如何在Windows上使用forever模块停止Node.js应用程序? [英] How to stop Node.js application using forever module on Windows?
问题描述
我已经经历了很多关于nodejs APP的永久模块的问题,但没有找到我的答案。
I have gone through so many questions regarding forever module for nodejs APP, but did not find my answer.
Forever
模块在Linux机器上工作正常,但现在我将我的APP放在Windows 7上并试图永远运行它。
首先我安装了永久模块
Forever
module is working fine on a Linux box but now I am putting my APP on Windows 7 and trying to run it with forever.
First i installed forever module as
npm install forever -g
之后我运行我的应用程序
after that i ran my app as
forever start app.js
通过说文件app.js永远运行并且我正在访问它运行正常我的应用程序成功。
it's running fine by saying file app.js is running with forever and I am accessing my app successfully.
当我执行命令永远停止app.js
我收到错误
When I execute a command forever stop app.js
I get the error
没有永远正在运行的文件
no forever file is running
请提示我任何人都在Windows上永远使用我如何在Windows上停止我的应用程序。
Please suggest me if anyone has used forever on windows that how can i stop my application on Windows.
推荐答案
使用永远列表
然后永远停止与id,例如永远停止0
这是一个示例输出
user@some-server]$ forever list
info: Forever processes running
data: uid command script forever pid id logfile uptime
data: [0] 9Xzw ng serve --host 0.0.0.0 --port 4009 13164 29579 /home/ec2-user/.forever/9Xzw.log 7:1:20:50.412
data: [1] wOj1 npm run-script app-start-dev 29500 24978 /home/ec2-user/.forever/wOj1.log 0:0:5:3.433
这里 0
就像一个索引,它位于输出的第一列。如果有两个进程在运行,我们可以使用 0
或 1
等索引来停止第一个或第二个进程。
Here 0
is like an index which is in the first column of the output. If there are two processes running, we can use indexes like 0
or 1
to stop the first or the second process.
永远停止0
或永远停止1
这篇关于如何在Windows上使用forever模块停止Node.js应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!