简体   繁体   English

Gulp-Connect投掷中的Live Reload:收听EADDRINUSE ::: 8080

[英]Live Reload in Gulp-Connect throwing: listen EADDRINUSE :::8080

I'm having the same problem as in this question (the answer doesn't work): 我遇到与此问题相同的问题(答案不起作用):

Gulp-connect shows an error 'listen EADDRINUSE' 8080 Gulp连接显示错误“听EADDRINUSE” 8080

I'm trying to get the gulp-connect liveReload option to work. 我正在尝试使gulp-connect liveReload选项起作用。 The script loads: 脚本加载:

Server started http://localhost:8080
[12:01:20] LiveReload started on port 35729

But then when I modify a html file in the project and hit save, I receive this error: 但是然后当我在项目中修改html文件并单击保存时,会收到此错误:

events.js:182
  throw er; // Unhandled 'error' event

Error: listen EADDRINUSE :::8080

I have tried changing ports as recommended (both localhost and liveReload) but it doesn't change anything. 我已尝试按照建议的方式更改端口(localhost和liveReload),但它没有任何更改。

Code: 码:

gulp.task('default', ['connect', 'watch'], function () {

browserify({
    entries: ['./builds/development/js/main.js'],
    debug: true
  })
  .bundle()
  .pipe(source('bundle.js'))
  .pipe(gulp.dest('myDestination'));
});

gulp.task('watch', function(){
    gulp.watch('myFileSources', ['default']);
});

gulp.task('connect', function(){
    connect.server({
        root: "myRoot",
        port: 8080, // 8081
        livereload: true // {port:35730}
    });
});

It's simply because your port 8080 is already occupied by another running server . 这仅仅是因为您的端口8080 已被另一台正在运行的服务器占用 Simply change the port with something available like 3XXX or 9XXX . 只需使用3XXX9XXX等可用的端口即可更改端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM