Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localhost doesn't work on WSL2 #6482

Closed
mvjl000 opened this issue Jan 28, 2021 · 2 comments
Closed

localhost doesn't work on WSL2 #6482

mvjl000 opened this issue Jan 28, 2021 · 2 comments

Comments

@mvjl000
Copy link

mvjl000 commented Jan 28, 2021

I'm using zsh WSL Ubuntu on windows 10, and when I try to run something on localhost (currently Node Express app) my browser can't find anything on http://localhost:8080 (port is correct). This same situation is in Create React App. No answer from http://localhost:3000, but 'On Your Network' http://...:3000 it works. However, when i switch to powershell, everything is as it should be.

Environment

Windows 10
Ubuntu 20.04
WSL2

Steps to reproduce

npm start

Expected behavior

Response on http://localhost:8080

Actual behavior

No response on http://localhost:8080, but it says:

Error: listen EADDRINUSE: address already in use :::8080

@jung-youjin
Copy link

Hi! I've faced similar issue previously and turned out that port 8080 was already in use by other node. You can try lsof -i :8080 or lsof -c node to view the list and kill whichever process that is in duplicate by kill -9 "PID". Hope this helped!

@therealkenc
Copy link
Collaborator

'On Your Network' http://...:3000 it works

There is no repro here, but if ... is your WSL2 ip address and it works, this is almost certainly a variation of #4851 (and/or #5298). The EADDINUSE on ipv6 will be because it is in use, especially if you are bouncing between Windows node and WSL node.

Use can use following to debug what is actually listening

$ netstat -nlt
$ netstat.exe -a -n -p TCP

@microsoft microsoft locked and limited conversation to collaborators Feb 1, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

3 participants