title: Cannot read property 'emit' of undefined in gulp-browserify
body: <p>i am running into a problem. I have created my own seed: <a href="https://github.com/damirkusar/leptir-angular-seed" rel="nofollow">https://github.com/damirkusar/leptir-angular-seed</a> with gulp, browserify and more. </p>
  
  <p>Everything worked fine, since i had the good idea to update node from 10.32 to 12.5, i am getting the below error. I think that this is since then. I tried it also on a different machine, same setup, same error.</p>
  
  <p>so, after npm install and bower install i am starting the app with:</p>
  
  <pre><code>gulp
  </code></pre>
  
  <p>or when trying to build the project with</p>
  
  <pre><code>gulp build
  </code></pre>
  
  <p>i am getting this error:</p>
  
  <pre><code>leptir-angular-seed/node_modules/gulp-browserify/node_modules/browserify/node_modules/module-deps/index.js:162
  rs.on('error', function (err) { tr.emit('error', err) });
                                    ^
  TypeError: Cannot read property 'emit' of undefined
  at ReadStream.&lt;anonymous&gt; (/leptir-angular-seed/node_modules/gulp-browserify/node_modules/browserify/node_modules/module-deps/index.js:162:39)
  at ReadStream.emit (events.js:107:17)
  at fs.js:1618:12
  at FSReqWrap.oncomplete (fs.js:95:15)
  </code></pre>
  
  <p>Here is also the link to the package.json: <a href="https://github.com/damirkusar/leptir-angular-seed/blob/450ffe99943036cd5a670e54ec3884c02bd7bb8a/package.json" rel="nofollow">https://github.com/damirkusar/leptir-angular-seed/blob/450ffe99943036cd5a670e54ec3884c02bd7bb8a/package.json</a>. </p>
  
  <p>but luckily, karma start executes the tests and all tests are passing.. </p>
  
  <p>Maybe some versions are not really supported correctly? 
  Does anybody have an idea what causes this problem?</p>
  
  <p>-- edit 2015-June-25 14:23</p>
  
  <p>I am using the module which cause the problem in my gulp file like this:</p>
  
  <pre><code>// Browserify task
  gulp.task('browserify', function () {
  gulp.src(paths.browserify[0])
      .pipe(browserify({
          insertGlobals: true,
          debug: true
      }))
      // Bundle to a single file
      .pipe(concat('bower.js'))
      // Output it to our dist folder
      .pipe(gulp.dest(paths.destination_public))
      .pipe(refresh(lrServer)); // Tell the lrServer to refresh;
  
  gulp.src(paths.browserify[1])
      .pipe(browserify({
          insertGlobals: true,
          debug: true
      }))
      // Bundle to a single file
      .pipe(concat('app.js'))
      // Output it to our dist folder
      .pipe(gulp.dest(paths.destination_public))
      .pipe(refresh(lrServer)); // Tell the lrServer to refresh;
  });
  </code></pre>
  
  <p>which browserifyies these app.js file and its content:</p>
  
  <pre><code>require('./modules/core');
  require('./modules/core');
  </code></pre>
  
  <p>and bower.js with its content:</p>
  
  <pre><code>'use strict';
  
  require('jquery');
  require('bootstrap');
  require('moment');
  require('underscore');
  require('angular');
  require('angular-animate');
  require('angular-bootstrap');
  require('angular-bootstrap-tpls');
  require('angular-cookies');
  require('angular-mocks');
  require('angular-resource');
  require('angular-ui-router');
  require('angular-ui-utils');
  require('angular-translate');
  require('angular-translate-loader-static-files');
  require('angular-translate-loader-url');
  require('angular-translate-storage-cookie');
  require('angular-translate-storage-local');
  </code></pre>
  
  <p>thank you so much</p>