node-windows
node-windows copied to clipboard
Service creation no error , Task Manager: Services does not show anything
The service looks like it was created as i have log records for the start of my node server. I do not see the Service within Task Manager: Services
PS C:\NodeApps\Cdsfeedt> node createService.js Service installed and is now starting up
{"level":"info","message":"Express server listening on port 9443","timestamp":"2015-08-24T12:36:49.801Z"}
Code that was used to create the service: (missing the details of the name and file location) File: createService.js
var Service = require('node-windows').Service;
// Create a new service object var svc = new Service({ name:'Name of service', description: 'lets put something here to help out the lookers', script: 'File patth') });
// Listen for the "install" event, which indicates the // process is available as a service. svc.on('install',function(){ svc.start(); });
svc.install();
The file path may matter... this behavior can occur if you're attempting to launch the service in a privileged directory without admin rights (such as C:\Program Files
).
using the following path C:\NodeApps\ or are you referencing the path to the node exe?
Ok i found one issue. You need to have C:\Node. So that was one of them. When running from command line no issues. When starting the Service it starts and then stops. Anywhere i can look to see what is happening?
here is the error: -g 0.25 -w 1 -r 3 -a n] terminated with 0 in the window event viewer
I was referring to the directory where the application exists.
Have you seen the wiki? It may give you a starting point.
Went through the Wiki page everything looks like it should. I have set the service to run as admin for time time being to see if helped. i know i don't have __dirname, it is hard code for the path
I have seen this same behavior on Windows 10, but only the very first time a service is installed. I can completely remove all trace of the service and application, and it installs fine after that.
Using an absolute path did not resolve the issue.
Looks like its the .NET 3.5 requirement. Once this is installed, the service starts normally.
In our installer, the installation process completes and attempts to install the service before the .NET 3.5 completes. However, no error is noted in the logs when this happens.
I too have this issue, running Windows 10
Fixes it, the issue I had was related to the name of the service. So I renamed it to one word and it worked
FIX: I was receiving the following error: "An error occurred while parsing EntityName..." whenever I tried to run the .exe file in the daemon folder after successfully installing my service (I had to do a screenshot of my command prompt because the window opens and closes very quickly).
Turns out the description of my service contained the "&" symbol which is not valid in XML elements. I uninstalled the current service; then changed my service description and installed it again and it works as expected now. Avoid the following in your Service's name and description: " ' <
&