title: fs.unlink() does not work and callback does not fire
body: <p>It was working a while ago, and I'm not sure what changed to where the <code>fs.unlink()</code> function seems to be totally skipped. The file for deletion is saved in the root package directory, while the typescript file that contains my code is in the <code>dist</code> folder. It worked when I passed in only the <code>fileName</code> like this: <code>fs.unlink(fileName)</code>. But now that doesn't work, and it also doesn't it work when I explicitly direct it to the root folder by using either <code>fs.unlink("./" + fileName)</code> or <code>fs.unlink("../" + fileName)</code>, or even when I hardcode the path!</p>
  
  <p>Below is my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> s3.putObject(params, function(err, data){
  // ...
       console.log("Data uploaded to S3 bucket");
              fs.unlink("./" + fileName, function(err){
                  if(err) {
                   return console.log("Delete error: " + err);
                  }
                  else{
                   console.log("file deleted successfully");
                  }
              });
              console.log("Before process.exit()");  
              process.exit();
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>When run, this code logs:</p>
  
  <pre><code>Data uploaded to S3 bucket
  Before process.exit()
  </code></pre>
  
  <p>So as you can see, it skips both the <code>if</code> and <code>else</code> statements on <code>fs.unlink()</code>, and doesn't delete the file. It's acting like that block of code doesn't exist at all and I can't figure out why.</p>