I tried using node-windows to create a service > "daemon" folder was getting created but service was not getting installed. Following is the code :
var Service = require('node-windows').Service;
var svc = new Service({
name: 'MyService',
description: 'Trial service',
script:'app.js',
abortOnError:false
});
console.log("....", svc);
svc.on('install', function() {
console.log('installed');
return svc.start();
});
svc.on('error', function() {
return console.log('error');
});
svc.on('start',function(){
console.log(svc.name+' started!');
});
svc.on('alreadyinstalled', function() {
return console.log('alreadyinstalled');
});
svc.install();
Here is the script I use and it works.