Http-server: Can't stop it with Ctrl + C [Windows only]

Created on 25 Sep 2015  路  20Comments  路  Source: http-party/http-server

It's very weird. I cannot stop the server with Ctrl + C.
I'm on windows 10 with the power shell D:

help-wanted needs-investigation

All 20 comments

I have the same problem. If I hit Ctrl + C, then Enter, it looks like server has stopped, but it hasn't. Also, it seems like it's ignoring set port (server should run on port 8080, but locahost:anyport returns the page), which results in conflicts with server running on different port.
Same OS, windows 10.

+1

+1

If you do http-server -p 8888, what does it report?

Report for @derhuerst

> node node_modules/http-server/bin/http-server -o --cors -p 8888

Starting up http-server, serving ./
Available on:
  http:10.1.3.70:8888
  http:127.0.0.1:8888
Hit CTRL-C to stop the server
[Thu, 07 Jan 2016 10:37:56 GMT] "GET /" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"
[Thu, 07 Jan 2016 10:37:56 GMT] "GET /dist/dependencies.js" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"
[Thu, 07 Jan 2016 10:37:56 GMT] "GET /dist/application.js" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"
[Thu, 07 Jan 2016 10:37:56 GMT] "GET /favicon.ico" "Mozilla/5.0 (Windows NT 10.0; WOW64) 
^C^C^C^C^C

There has been a significant amount of changes since http-server@latest. Try master from GitHub and check if the issue is resolved.

I've just noticed that Ctrl + C works on my Mac but not on windows. Hope this helps for future bugfixing.

@derhuerst I don't want to have a NPM package working state in my project but thanks for your help :smiley:

@janbiasi why in your project? clone the repo, install dependencies and call the executable.

@derhuerst because I use it as a dependecy in a project for a customer and I only use dependencies which I can maintain with a package manager. Main reason is that other collaborators will get a mess If i use NPM, Bower and direct clones from GitHub repositories. So it won't make any sense if the master would resolve the Ctrl + C issue :wink:

@janbiasi

So it won't make any sense if the master would resolve the Ctrl + C issue

First, npm can also load dependencies from Git repos, including tags (for releases).

Second, there is a general interest in fixing bugs in this package, so it would help if cloned it somewhere and just quickly checked if the bug still appears on master.

@derhuerst I said that I use NPM and Bower already, but I won't use the master branch in the project. Instead found another package that works pretty good. Maybe checking the master branch of this proj if I'll have enough time.

+1 in raspbian

@samirop Did you try http-server@latest (using npm normally) or master?

+1

+1

This issue is fairly random...and I haven't yet been able to pin down the cause (as it's not been consistently a problem). However, I do now (occasionally...) witness this on Windows 10 running Node 8.6.0 and http-server 0.10.0.

If any of you have more info on scenarios that cause (or prevent) this, do tell!

+1

Seemingly random, maybe once every 20 times?

Windows 10 (MINGW)
Node 8.11.1

Does not work on mac

+1 have the same problem on
windows 10
node 10.9.0

For anyone who's having this issue, does CTRL+D work at all?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LeaVerou picture LeaVerou  路  5Comments

ghost picture ghost  路  4Comments

ducklord picture ducklord  路  5Comments

rgladwell picture rgladwell  路  7Comments

laughinghan picture laughinghan  路  5Comments