title: Why is Gulp failing randomly with ENOENT error (or) failing to generate output (or accidentally deleted)?
body: <h1>Software Environment</h1>
  
  <p>I am using <strong>NodeJS v4.2.1</strong> on Windows.<br>
  I have included my <code>gulpfile.js</code>, <code>bower.json</code>, and <code>package.json</code> files at the bottom.</p>
  
  <hr>
  
  <h1>Additional Information</h1>
  
  <ol>
  <li>I don't have any IDE running at the moment. So it is definitely <strong>not</strong> a problem with files being locked by an external program.</li>
  <li>I am running everything on the command prompt.</li>
  </ol>
  
  <hr>
  
  <h1>Question</h1>
  
  <ol>
  <li>Is something wrong with my <code>gulpfile.js</code>?</li>
  <li>Is this a bug with <code>NodeJS v4.2.1</code>?</li>
  <li>Is this a bug with Gulp?</li>
  </ol>
  
  <hr>
  
  <h1>Problem</h1>
  
  <p>I am experiencing these two problems when I run <code>gulp</code> at command prompt.</p>
  
  <h2>Problem #1</h2>
  
  <p>My <code>build</code> folder would not be created every other time when I run <code>gulp</code>.<br>
  When I run it first time, it creates the <code>build</code> folder with <code>copy-bower</code> Gulp task output artifacts.  </p>
  
  <p>When I run it another time after it, <code>build</code> folder doesn't get created.<br>
  The gulp console output clearly shows my <code>copy-bower</code> task ran <strong>after</strong> the <code>clean</code> task, but I don't see the <code>build</code> folder created.</p>
  
  <pre><code>[21:21:32] Using gulpfile
  [21:21:32] Starting 'clean'...
  [21:21:32] Finished 'clean' after 3.66
  [21:21:32] Starting 'copy-bower'...
  [21:21:32] Finished 'copy-bower' after
  [21:21:32] Starting 'default'...
  [21:21:32] Finished 'default' after 6.
  
  Directory: C:\Users\stun\Desktop\test-app
  
  Mode                LastWriteTime         Length Name
  ----                -------------         ------ ----
  d-----       10/22/2015   9:00 PM                bower_components
  d-----       10/22/2015   8:59 PM                node_modules
  -a----       10/22/2015   9:30 PM            347 bower.json
  -a----       10/22/2015   9:31 PM            421 gulpfile.js
  -a----       10/22/2015   9:30 PM            301 package.json
  </code></pre>
  
  <hr>
  
  <h2>Problem #2</h2>
  
  <p>From time to time, I get either one of these errors.</p>
  
  <pre><code>events.js:141
      throw er; // Unhandled 'error' event
  ^
  
  Error: ENOENT: no such file or directory, chmod 'C:\Users\stun\Desktop\test-app\build\bower_components\jquery\dist\jquery.min.map'
  at Error (native)
  </code></pre>
  
  <p>Another Error</p>
  
  <pre><code>events.js:141
        throw er; // Unhandled 'error' event
        ^
  
  Error: ENOENT: no such file or directory, stat 'C:\Users\stun\Desktop\test-app\build\bower_components\bootstrap\dist\fonts'
      at Error (native)
  </code></pre>
  
  <hr>
  
  <h1>gulpfile.js</h1>
  
  <pre class="lang-js prettyprint-override"><code>var gulp = require('gulp'),
      del = require('del');
  
  gulp.task('clean', function () {
      del(['build']);
  });
  
  gulp.task('copy-bower', ['clean'], function () {
      var src = [
          './bower_components/bootstrap/dist/**',
          './bower_components/jquery/dist/*'
      ];
      gulp.src(src, { base: '.' })
         .pipe(gulp.dest('./build/'));
  });
  
  gulp.task('default', ['copy-bower'], function () { });
  </code></pre>
  
  <h1>bower.json</h1>
  
  <pre class="lang-js prettyprint-override"><code>{
    "name": "test-app",
    "description": "testing gulp and bower",
    "main": "",
    "moduleType": [],
    "authors": [""],
    "license": "MIT",
    "homepage": "",
    "private": true,
    "ignore": [
      "**/.*",
      "node_modules",
      "bower_components",
      "test",
      "tests"
    ],
    "dependencies": {
      "bootstrap": "~3.3.5"
    }
  }
  </code></pre>
  
  <h1>package.json</h1>
  
  <pre class="lang-js prettyprint-override"><code>{
    "name": "test-app",
    "version": "1.0.0",
    "description": "testing gulp and bower",
    "main": "",
    "scripts": {
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1"
    },
    "author": "",
    "license": "ISC",
    "devDependencies": {
      "del": "^2.0.2",
      "gulp": "^3.9.0"
    }
  }
  </code></pre>