title: Kill child process at the end of promise
body: <p>I use the following code to create child process, the process is working as expected, what I want to do now is at the end of the process kill it , I try with the last then (which if I put BP it stops there after the process done) my question is how to kill it properly and avoid this error.</p>
  
  <p>getCmd provide the command to run and this is working as expected </p>
  
  <pre><code>var childProcess = Promise.promisify(require('child_process').exec);
  
  ....
              .then(getCmd)
              .then(childProcess)
              .spread(function (stdout, stderr) {
                  console.log(stdout, stderr);
                  return stdout;
              }).then(function(){
  
                  childProcess.kill()
              })
  </code></pre>
  
  <p>when the line <code>childProcess.kill()</code> is executed  I got error :</p>
  
  <pre><code>[TypeError: undefined is not a function]
  </code></pre>
  
  <p>How to overcome this issue and kill the process at the end</p>