简体   繁体   English

在Cygwin上将Node.js作为服务运行

[英]Running Node.js as a service on Cygwin

I'm trying to run a Node.js http server through cygwin as a service, so that it continues to run even once I've logged out (machine still running). 我正在尝试通过cygwin作为服务运行Node.js http服务器,以便即使我注销(机器仍在运行),它也可以继续运行。 The closest I've been able to find is: 我能找到的最接近的是:

cygrunsrv -I service_name-p path [-a arguments] 
   [-e VAR=VALUE] [-t auto|manual] [-u user] [-w passwd]

used as 用作

cygrunsrv -I nodeserver -p /usr/local/bin/node -a ~/server.js 

but that doesn't seem to run properly... Not sure what I'm doing wrong or if this is possible 但这似乎运行不正常...不确定我在做什么错或是否可能

D'oh, seems like node-worker was the cause behind the probem. D'oh,似乎是节点工作人员是探查背后的原因。 It runs but that part of the pie wasn't working... Oh well. 它运行了,但是那部分馅饼没有用...哦,很好。 At least I figure it out. 至少我知道了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM