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

Dev server continues to run after aborting npm run dev (Ctrl+C) #802

Closed
alex996 opened this issue Jul 16, 2017 · 11 comments
Closed

Dev server continues to run after aborting npm run dev (Ctrl+C) #802

alex996 opened this issue Jul 16, 2017 · 11 comments

Comments

@alex996
Copy link

alex996 commented Jul 16, 2017

Description

I had to restart the dev server after pulling in a package. In my terminal, where npm run dev command was being executed, I pressed Ctrl+C to abort it. Then I ran npm run dev again and it failed with some reference to localhost:8080, and from what I understood, the port was already occupied. Indeed, when I went to localhost:8080 the app was still running even though npm run dev was terminated and the terminal was closed.

Steps

  1. npm run dev
  2. Ctrl+C
  3. npm run dev

Results

  • Expected: it should restart the dev server
  • Actual: it fails with an error; the server isn't halted and continues to run on localhost:8000

Brute-force fix

Kill the process manually. In WIndows, you can kill Node.js: Server-side JavaScript from Task Manager.

@maxmilton
Copy link

Could you give some information about your environment?

  1. What OS are you using?
  2. What terminal are you running the command in?
  3. Which version of Node.js?
  4. Do you have the same issue with a fresh copy of the template?
  5. Are you using a command other than npm run dev?

@Christilut
Copy link

Christilut commented Jul 18, 2017

I have the same thing.

npm run dev
press Ctrl-C
reload page and its still running

In order to really stop it I have to run taskkill /F /IM node.exe

Windows 10
Git bash
node 8.1.4
webpack 2.3.3
webpack-dev-middleware 1.11.0

Edited: meant webpack 2.3.x

@alex996
Copy link
Author

alex996 commented Jul 18, 2017

@maxmilton Same setup as @Christilut except I got node 6.11.1 and webpack 2.6.1. Everything else is up to date and the project is brand-new. No other commands are involved. I noticed that this issue doesn't occur with webpack-simple template.

@KerimG
Copy link

KerimG commented Jul 19, 2017

I have the same issue.

Windows 10
Git bash / cmd
node 8.1.4
webpack 2.6.1
webpack-dev-middleware 1.10.0
webpack-hot-middleware 2.18.0

Only "npm run dev" is used.

@zhaokuohaha
Copy link

zhaokuohaha commented Aug 21, 2017

same issue

  • os: windows 10
  • terminal: git bash git version 2.14.1.windows.1
    but It's OK in power shell
  • node: 8.3.0
  • npm: 5.3.0
    "webpack": "^2.6.1",
    "webpack-bundle-analyzer": "^2.9.0",
    "webpack-dev-middleware": "^1.10.0",
    "webpack-hot-middleware": "^2.18.0",

@dwjohnston
Copy link

This is very possibly this issue from git for windows: git-for-windows/git#1248

@LinusBorg
Copy link
Contributor

Doesn't seem to be directly related to this template. Plus we will be switching to webpack-dev-server in the coming days (#975), so this would have to be re-evaluated after that.

@Awais-cb
Copy link

Awais-cb commented Oct 27, 2018

i had the same issue on windows solved it using the commands below remember these commands will only work in cmd not in gitbash
this command will give you the process id of the process running on that specific port

$ netstat -ano | find ":3000 "

this command will tell you which program is using this port

$ tasklist /fi "pid eq {process-id}"

and this will kill that process

$ taskkill /pid {process-id} /f

@Awais-cb
Copy link

Awais-cb commented Oct 27, 2018

or you can simply run task manager and kill node's process

@randy8891
Copy link

I have the same thing.

npm run dev
press Ctrl-C
reload page and its still running

In order to really stop it I have to run taskkill /F /IM node.exe

Windows 10
Git bash
node 8.1.4
webpack 2.3.3
webpack-dev-middleware 1.11.0

Edited: meant webpack 2.3.x

Worked for me.. thanks @Christilut

@mlclmtan
Copy link

i had the same issue on windows solved it using the commands below remember these commands will only work in cmd not in gitbash
this command will give you the process id of the process running on that specific port

$ netstat -ano | find ":3000 "

this command will tell you which program is using this port

$ tasklist /fi "pid eq {process-id}"

and this will kill that process

$ taskkill /pid {process-id} /f

Thank you! It works in both Ubuntu and Windows CMD

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

10 participants