Node JS application service stopped running on system restart on Windows 10.How I can solve this issue?

218 Views Asked by At

I am using windows service for running my nodejs application on system restart. But my application is not running, whenever I checked in services it's showing blank in status bar and I have already selected Startup Type as Automatic. I also checked logs in Event Viewer but I found nothing related to my service (e.g. information,warnings,errors,etc.). I used below code to install my nodejs application as service in Windows 10.

var Service = require('node-windows').Service;
var svc = new Service({
    name:'Local Server for Myapp',
    description:'Nodejs code to create local server for Myapp.',
    script: "C:\\path-to-myapp-server\\server.js"
});
svc.on('install',function(){
    svc.start();
});
svc.install();
0

There are 0 best solutions below