title: Killing a NodeJS Child Process with child.kill('SIGHUP')
body: <p>Here is my code:</p>
  
  <p><strong>test.js</strong></p>
  
  <pre><code>const {exec} = require("child_process")
  
  var c = exec("php artisan serve", {
          cwd: "C:/Users/DELL/Laravel Projects/lktest3"
      }, (error, stdout, stderr) =&gt; {
          if (error) {
              console.error(`exec error: ${error}`);
          return;
      }
      console.log(`stdout: ${stdout}`);
      console.log(`stderr: ${stderr}`);
  })
  setTimeout(() =&gt; {
      c.kill('SIGHUP')
  }, 10000);
  </code></pre>
  
  <p>When I run <code>node test.js</code>, I get this error:</p>
  
  <pre><code>$ node test.js
  internal/child_process.js:397
        throw errnoException(err, 'kill');
        ^
  
  Error: kill ENOSYS
      at exports._errnoException (util.js:1018:11)
      at ChildProcess.kill (internal/child_process.js:397:13)
      at Timeout.setTimeout (C:\Users\DELL\Documents\laravel-kit\test.js:14:7)
      at ontimeout (timers.js:386:14)
      at tryOnTimeout (timers.js:250:5)
      at Timer.listOnTimeout (timers.js:214:5)
  </code></pre>
  
  <p>I wrote this code as it is said in <a href="https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal" rel="nofollow noreferrer">NodeJS Child Process API</a>. But it's not working.</p>