I have build a node server and have been testing it periodically but running from powershell. Right now I am trying to use node-windows package to run the node server as a service, so that the server runs continuously. I get the following error while trying to start the service
When saw the events viewer I get the following error
Here is the code for the service creation:
var Service = require('node-windows').Service;
// Create a new service object
var svc = new Service({
name:'dlserver-9',
description: 'This is dlserver',
script: 'index.js',
allowServiceLogon: true
});
svc.install();
The service starts but the next second it terminates automatically when viewed in the events viewer. I am running the node server on windows server 2019 os on azure vm.