title: Using NSSM to start a NodeJs process as a windows service is not working
body: <p>I have seen countless articles on how to use NSSM (<a href="http://nssm.cc/" rel="noreferrer">http://nssm.cc/</a>) to start a NodeJS process. </p>
  
  <p>So, I have the following simple NodeJS file:</p>
  
  <pre><code>var http = require('http');
  http.createServer(function (req, res) {
      res.writeHead(200, { 'Content-Type': 'text/html' });
      res.end('&lt;p&gt;Hello World&lt;/p&gt;');
  }).listen(8000);
  
  console.log('Server running on http://localhost:8000/');
  </code></pre>
  
  <p>I am using this command to install the NodeJS file as a windows service:</p>
  
  <blockquote>
    <p>"C:\Program Files\SimpleNode\nssm.exe" install SimpleNode "C:\Program Files\SimpleNode\node.exe" "C:\Program Files\SimpleNode\simple.js"</p>
  </blockquote>
  
  <p>The service is installed.  When I start it I get an error message, the services is in the Paused state and I see the following error in Event Viewer:</p>
  
  <blockquote>
    <p>GetProcessTimes() failed: The handle is invalid.</p>
  </blockquote>
  
  <p>This should be pretty simple.  I have tried using a domain account that has local admin rights.  I have tried a couple of different port numbers.  The app does work correctly when I start it from the command line.  </p>
  
  <p>MORE NOTES:
  This is running on 64-bit Windows 2008 R2 server.  I have made sure I am running all 64-bit executables for both NSSM and Node.  I have also tried using 32-bit executables for both.</p>
  
  <p>Can anyone tell me what I am missing?  Can someone else replicate this issue?</p>