title: Cypress task fails and complains that task event has not been registered in the plugins file
body: <p>I am using the cypress <code>cy.task()</code> method/ function to copy a <code>csv</code> file from one directory to another directory. Below is my <code>cy.task('copycsvFile')</code> and relevant code written in <code>support/index.js</code> file. While running it throws following error; 
  CypressError: cy.task('copycsvFile') failed with the following error:
  <code>The 'task' event has not been registered in the plugins file. You must register it before using cy.task()</code> Any idea why this is not recognised ? </p>
  
  <p>Node version : v10.15.3, 
  Cypress version : 3.1.5</p>
  
  <p>//sample-spec.js file  </p>
  
  <pre><code>cy.task('copycsvFile');
  </code></pre>
  
  <p>Below is my <code>index.js</code> file 
  // support/index.js file</p>
  
  <pre><code>const fs = require('fs');
  
  module.exports = (on) =&gt; {
      on('task', {
          copycsvFile: (Obj)=&gt;{
            var fs = require('fs');
           fs.createReadStream('C:/Users/SomeName/Downloads/Export_Survey_CSV.csv').pipe(fs.createWriteStream('C:/User/Client/Client - Cypress Web UI Tests/cypress/fixtures/Export_Survey_CSV.csv'));
          }
      });
  };
  </code></pre>