Receiving Caught exception: Error: listen EACCES while running gulp

1.2k views Asked by At

I am using gulp in my project. I would like to start the node server via a gulp task.

This is my gulpfile.js:

var server = require('gulp-develop-server');

gulp.task('server:start', ['scripts'], function() {
  server.listen({
      path: '/home/ubuntu/node-v0.10.33/TestApp/app.js',
  });
});

// restart server if app.js changed 
gulp.task('server:restart', function() {
   gulp.watch(['/home/ubuntu/node-v0.10.33/TestApp/app.js'], server.restart);
});

gulp.task('default', ['server:start']);

My node port number is 80.
And I am running this code in Ubuntu server:

ubuntu@ip-xxx-xx-xx-xx:~/gulpReact$ gulp
[12:32:35] Using gulpfile ~/gulpReact/gulpfile.js

[12:32:35] Starting 'server:start'...
[12:32:35] Finished 'server:start' after 3.27 ms
[12:32:35] Starting 'default'...
[12:32:35] Finished 'default' after 7.9 μs
[12:32:35] Development server listening. (PID:7653)
Caught exception: Error: listen EACCES

Any thoughts?

1

There are 1 answers

0
Dr1Ku On

You're either

  • Running two servers on the same port (:80), try running sudo netstat -tulpn to see which processes are currently listening
  • Not running gulp with sudo (apparently an issue under *nix)

Other than that, gulp-liveconnect may or may not run on the same port.

You can also try binding to another interface address, e.g. * or 0.0.0.0 instead of localhost/127.0.0.1.