0

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?

  • I don't know NSSM, but from a quick scan at the doc, you may want to describe how you created the service with NSSM (easiest if it was just via command line an not the GUI). Is it possible that it is something simple like an unset working directory, etc? – barry-johnson Mar 26 '17 at 20:12
  • I did use the GUI and in the application tab I entered the path to node.exe, the startup directory where my js file is and the name of the js file in arguments. Works for all other node files I create...seems that it just exits when I try to start this one with no error. – Scott Conklin Mar 27 '17 at 00:20

0 Answers0