grunt-contrib-connect icon indicating copy to clipboard operation
grunt-contrib-connect copied to clipboard

Fatal error: Port 8080 is already in use by another process.

Open kurtinlane opened this issue 11 years ago • 11 comments

Several team members (myself included) ran into this error when running grunt. We got around it by adding 'foundPort = 8080' to node_modules/grunt-contrib-connect/tasksconnect.js on line 153

This is a gross dirty hack to get it to work, but wanted to let you guys know about the issue we found.

Thanks

kurtinlane avatar Jul 30 '14 21:07 kurtinlane

I can confirm this error, but it seems to happen only for our windows users. It seems to only occur for 0.0.0.0, but not localhost. (We used 0.7.1 before, which runs well.)

donaldpipowitch avatar Jul 31 '14 05:07 donaldpipowitch

@donaldpipowitch Thanks for checking! We shall investigate :mag:

vladikoff avatar Jul 31 '14 05:07 vladikoff

One of our engineers found the culprit.

The "error" was probably introduced by this commit in portscanner: https://github.com/baalexander/node-portscanner/commit/a854ec6bd64a66dae9013b2bd92ff89ad389535d It now correctly destroys a socket instead of ending it. What happens now for us is that 8080 collides with "avast! Web Shield".

donaldpipowitch avatar Jul 31 '14 08:07 donaldpipowitch

Any update on this?

donaldpipowitch avatar Sep 11 '14 12:09 donaldpipowitch

If avast! is using :8080, what can be done? Shouldn't you just close avast, or switch to a different port?

jeanbza avatar Sep 27 '14 12:09 jeanbza

Well, I'm not really a "port" export. You could proablby close avast, but it worked before, so my first question would be: is this a bug now as it doesn't work anymore or was it a bug before as it worked?

donaldpipowitch avatar Sep 27 '14 13:09 donaldpipowitch

Just discovered the same issue now... Seems to occur when starting a server, stopping it and then starting again. Can fix it by killing the Node process's on the port.

$ lsof -i tcp:8080 | grep node | awk '{print $2}'
> PID

$ kill -9 PID

MerlinMason avatar Dec 07 '16 11:12 MerlinMason

I found the same problem in Mac's Terminal. Occurs to me when starting a server, stopping it and then starting again. Restarting terminal window solved the problem.

mayank-gangwal avatar Feb 26 '18 17:02 mayank-gangwal

for me the error happens no matter what port I specify (Using Windows 10 and "localhost" as host)

erredeco avatar Oct 18 '18 12:10 erredeco

I get the same error on MAC; downgrading to grunt-contrib-connect 1.0.2 solved my problem

erredeco avatar Nov 01 '18 21:11 erredeco

Restart GitHub CodeSpace

narisunike avatar May 23 '23 08:05 narisunike