title: NodeJS , gulp , Error: listen EADDRINUSE :::3000
body: <p>i am working with NodeJS and i am using gulp.</p>
  
  <p>My foler look like that : </p>
  
  <pre><code>Root 
    dist
    node_modules
    src
      index.html
    gulpfile.js
    package.json
  </code></pre>
  
  <p>My gulpfile is :</p>
  
  <pre><code>"use strict";
  
  var gulp = require('gulp');
  var connect = require('gulp-connect'); // runs a local dev server 
  var open = require('gulp-open'); // open a URL in a web browser
  
  var config ={
      port : 3000,
      devBaseUrl : 'http://localhost',
      paths:{
          html:'./src/*.html',
          dist:'./dist'
      }
  }
  
  //Start a local development server 
  gulp.task = ('connect' , function(){
      connect.server({
          root:['dist'],
          port: config.port,
          base: config.devBaseUrl,
      }); 
  });
  
  gulp.task('open', ['connect'], function(){
      gulp.src('dist/index.html').pipe(open({uri: config.devBaseUrl + ":" + config.port + '/'}))
  });
  
  gulp.task('html',function(){
      gulp.src(config.paths.html)
          .pipe(gulp.dest(config.paths.dist))
          .pipe(connect.reload());
  });
  
  gulp.task('default', ['html', 'open']);
  </code></pre>
  
  <p>When i am type 'gulp' in the cmd i get this error : </p>
  
  <pre><code>C:\Users\maor\Documents\NodeProject\2&gt;gulp
  [13:18:28] Using gulpfile ~\Documents\NodeProject\2\gulpfile.js
  [13:18:28] Server started http://localhost:3000
  events.js:160
        throw er; // Unhandled 'error' event
        ^
  
  Error: listen EADDRINUSE :::3000
      at Object.exports._errnoException (util.js:1018:11)
      at exports._exceptionWithHostPort (util.js:1041:20)
      at Server._listen2 (net.js:1262:14)
      at listen (net.js:1298:10)
      at Server.listen (net.js:1394:5)
      at ConnectApp.server (C:\Users\maor\Documents\NodeProject\2\node_modules\gulp-connect\index.js:57:19)
      at new ConnectApp (C:\Users\maor\Documents\NodeProject\2\node_modules\gulp-connect\index.js:37:10)
      at Object.server (C:\Users\maor\Documents\NodeProject\2\node_modules\gulp-connect\index.js:170:12)
      at Gulp.gulp.task (C:\Users\maor\Documents\NodeProject\2\gulpfile.js:18:10)
      at Object.&lt;anonymous&gt; (C:\Users\maor\Documents\NodeProject\2\gulpfile.js:29:6)
  </code></pre>
  
  <p>I really dont know what the problem is , i already checked and the port : 3000 is free. can you guys help me figure what the problem is ?</p>