Skip to content
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

[WSL / Server] Can't access local server in Windows Subsystem for Linux #2696

Closed
rosuH opened this issue Aug 9, 2017 · 6 comments
Closed

Comments

@rosuH
Copy link

rosuH commented Aug 9, 2017

Environment Info

Node version(node -v):
v8.1.4

Hexo and Plugin version(npm ls --depth 0):

hexo: 3.3.8
hexo-cli: 1.0.3
os: Linux 4.4.0-43-Microsoft linux x64
http_parser: 2.7.0
node: 8.1.4
v8: 5.8.283.41
uv: 1.12.0
zlib: 1.2.11
ares: 1.10.1-DEV
modules: 57
openssl: 1.0.2l
icu: 59.1
unicode: 9.0
cldr: 31.0.1
tz: 2017b

├── hexo@3.3.8
├── hexo-deployer-git@0.3.1
├── hexo-directory-category@1.0.3
├── hexo-filter-auto-spacing@0.2.1
├── hexo-generator-archive@0.1.4
├── hexo-generator-category@0.1.3
├── hexo-generator-index@0.2.1
├── hexo-generator-search@2.1.1
├── hexo-generator-tag@0.2.0
├── hexo-prism-plugin@2.1.2
├── hexo-renderer-ejs@0.2.0
├── hexo-renderer-marked@0.2.11
├── hexo-renderer-stylus@0.3.3
└── hexo-server@0.2.2

For question

Can't access the local server after executing hexo s or hexo server.
The hexo was installed in WSL(Windows Subsystem for Linux) and it worked fine before.
The browser shown:

ERR_CONNECTION_REFUSED

After executing hexo s or hexo server it shows:

INFO Start processing
INFO Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.

Here are some weird things:

  • Hexo works may be fine because it didn't throw out any issue when I executed hexo s or hexo g.( even in debug mode)
  • I can't find any program occupied the port which running the local server.
    • For example, hexo server runs on port 4000 in WSL and I find nothing after executing netstat -an | findstr 400 (also in others ports)

Here are the things I tried but not work:

  • Tried 127.0.0.1:4000 , localhost:4000 and 0.0.0.0:4000
    • Also other ports
  • Changed the port
  • Deleted node_modules folder & Reinstall all plugins
  • Cleaned hexo cache & Re-generated all files
  • Restart my computer!

My English is poor. I will provide Chinese version if you need.
Thanks.

@NoahDragon
Copy link
Member

Seem like an issue under WSL. microsoft/WSL#1853

As Hexo support Windows CMD, you could run it in powershell/prompt command line. WSL is still in Beta version, which isn't stable yet.

@rosuH
Copy link
Author

rosuH commented Aug 9, 2017

@NoahDragon Thanks.
According to the Microsoft/BashOnWindows#1853, I find that the actual reason for this issues was my Antivirus software(火绒).
hexo works fine after uninstalling that antivirus.

@rosuH rosuH closed this as completed Aug 9, 2017
@imgwho
Copy link

imgwho commented Mar 12, 2018

the same problem on win10 1709 16299.251 sooooooooooooooooo sad

@TheBlueSkim
Copy link

@imgwho so am I. I'm using swoole to test the tcp server, but... tears drop.

@qualityshepherd
Copy link

FWIW, if you're running on a pixelbook/linux, use penguin.linux.test:4000 instead of locahost:4000.

@ksjogo
Copy link

ksjogo commented Dec 26, 2019

Other node apps run fine with localhost. What is hexo serve doing differentially?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants