I am using NSSM to create a node process. I have a simple script that listens for messages sent to an MSMQ queue which uses node-msmq https://www.npmjs.com/package/node-msmq
const msmq = require('node-msmq');
const fs = require('fs');
var queue = msmq.openOrCreateQueue('.\\private$\\testqueue');
// Set receive listener callback
queue.on('receive', (msg) => {
console.log(msg.body);
fs.writeFileSync("C:\\tmp\\test.xml", msg.body);
}
console.log('listening for messages..');
// Start receiving messages from the queue
queue.startReceiving();
This works fine when run via the command line. I can create it as a service but as soon try to start the service created by NSSM, i get the following popup alert from the services cpl but with no application error.
windows could not start the service on local computer... the service did not return an error Can anyone tell me what the issue could be?