vuejs-templates / webpack

A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.
MIT License
9.7k stars 4.38k forks source link

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

Closed alex996 closed 7 years ago

alex996 commented 7 years ago

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

Brute-force fix

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

maxmilton commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

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 commented 7 years ago

same issue

dwjohnston commented 7 years ago

This is very possibly this issue from git for windows: https://github.com/git-for-windows/git/issues/1248

LinusBorg commented 7 years ago

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 commented 6 years ago

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 commented 6 years ago

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

randy8891 commented 4 years ago

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 commented 3 years ago

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