I want to create a nodejs service, so that the node server starts as my computer starts, and i do not have to keep the command prompt open all the time. I m tryng to achieve this by using NSSM.
Here is the command to create the service:
nssm.exe install jewel-server C:\Program Files\nodejs\node.exe D:\jewel\server.js
Run service:
net start jewel-server
But this doesnt work and give this error:
The jewel-server service is starting.
The jewel-server service could not be started.
A service specific error occured: 3.
I checked error code 3 means the path is not correct but the is path correct. Can you tell what i am doing wrong, or is there any other open source & more reliable alternative to NSSM
Version:
NSSM
version: 2.24
Windows-7 64bit
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\\my\\node\\script. js' }); // Listen for the "install" event, which indicates the // process is available as a service.
The way parameters were passed was not correct, So used the NSSM GUI to set the parametes:
Open GUI: nssm.exe install jewel-server
Once the GUI is open give in the following values.
Path: C:\Program Files\nodejs\node.exe
Arguments: D:\jewel\server.js
Press Install service
Done! You can start the service now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With