我已经下载了node.js可执行文件。如何将可执行文件作为windows服务运行?我不能使用标准的node.js安装程序,因为我需要同时运行多个版本的node.js。
发布于 2013-09-03 12:44:08
聚会迟到了,但node-windows也会这么做的。
它还内置了系统日志。
有一个API可以从代码创建脚本,即
var Service = require('node-windows').Service;
// Create a new service object
var svc = new Service({
name:'Hello World',
description: 'The nodejs.org example web server.',
script: 'C:\\path\\to\\helloworld.js'
});
// Listen for the "install" event, which indicates the
// process is available as a service.
svc.on('install',function(){
svc.start();
});
svc.install();
FD:我是这个模块的作者。
发布于 2012-07-13 20:40:00
WinSer是流行的NSSM (Non-Sucking Service Manager)的node.js友好包装器
发布于 2021-02-13 17:14:23
https://nssm.cc/服务帮助器很好地通过批处理文件创建windows服务,我在nssm中使用,对任何应用程序和任何文件都很好用。
https://stackoverflow.com/questions/10547974
复制相似问题