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?
You're either
80
), try runningsudo netstat -tulpn
to see which processes are currently listeninggulp
withsudo
(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.
*
or0.0.0.0
instead oflocalhost
/127.0.0.1
.