Search code examples
node.jsportgulplivereload

EAddrInUse for live reload - node js - on running gulp command


I run gulp for my mean-io stack application.

I get the below error.

13:15:54] Starting 'server'...
13:15:54] Finished 'server' after 47 ms
13:15:54] Live reload server listening on: 35729

.. Uhoh. Got error listen EADDRINUSE ...
rror: listen EADDRINUSE
   at errnoException (net.js:901:11)
   at Server._listen2 (net.js:1039:14)
   at listen (net.js:1061:10)
   at Server.listen (net.js:1127:5)

I guess the port 35729 is being used by some other application. Am I right? I have also tried changing the port number in livereload.js. But then, I got the same error.

The below are the files where, I see the 35729 port number assigned. Please let me know if should change the port number any where.

 myApp\node_modules\grunt-contrib-watch\node_modules\tiny-lr-fork\lib\public\livereload.js:
321:     this.port = 35829;                
myApp\node_modules\grunt-contrib-watch\node_modules\tiny-lr-fork\lib\server.js
20:   options.port = parseInt(options.port || 35729, 10);             
myApp\node_modules\grunt-contrib-watch\node_modules\tiny-lr-fork\node_modules\noptify\index.js:
21: //       .option('port', '-p', 'Port to listen on (default: 35729)', Number)        
myApp\node_modules\grunt-contrib-watch\node_modules\tiny-lr-fork\bin\tiny-lr:
14:   .option('port', '-p', 'Port to listen on (default: 35729)', Number)
18: opts.port = opts.port || 35729;

Thanks.


Solution

  • I made a change in gulpexpress/index.js, port number changed to 35829. And it worked.

    It seems same port number 35729 is used more than once for two different process.