title: How to debug gulpfile.js
body: <p>What is the proper way to execute <code>node-inspector</code> in order to be able to debug <code>gulpfile.js</code>?</p>
  
  <p>I've tried following (code in my gulpfile requires <code>harmony</code> and <code>harmony-arrow-functions switches</code>):</p>
  
  <pre class="lang-sh prettyprint-override"><code>node-debug --nodejs --harmony --nodejs --harmony-arrow-functions /home/user/.npm-packages/bin/gulp default
  </code></pre>
  
  <p>Node inspector was properly loaded however it was not possible to set breakpoint in gulpfile neither before nor after the file was <a href="https://github.com/gulpjs/gulp/blob/master/bin/gulp.js#L116" rel="noreferrer">loaded</a>. It was also not possible to set breakpoints in <code>gulp/index.js</code> and <code>orchestrator/index.js</code> files. And it was not possible to "step into" following statement (<a href="https://github.com/gulpjs/gulp/blob/master/bin/gulp.js#L129" rel="noreferrer">whole source</a>):</p>
  
  <pre class="lang-javascript prettyprint-override"><code>gulpInst.start.apply(gulpInst, toRun);
  </code></pre>
  
  Environment:
  
  <ul>
  <li>Fedora 21 x64</li>
  <li>Node Inspector v0.9.2</li>
  <li>node v0.12.0</li>
  <li>gulp
  
  <ul>
  <li>CLI version 3.8.11</li>
  <li>Local version 3.8.11</li>
  </ul></li>
  </ul>