Dev server continues to run after aborting `npm run dev` (Ctrl+C)
See original GitHub issueDescription
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
npm run dev
Ctrl+C
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.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Node JS ctrl + C doesn't stop server (after starting server with ...
It seems to be a specific problem running express via npm on Windows. If you run the server directly via the c:>node server.js...
Read more >Node JS Tutorial: The Basics
Start a web browser (Chrome, Firefox). Issue URL http://localhost:3000/ . You shall see a hello-world message. To stop the server, press Ctrl-C ......
Read more >`npm run dev` is a long-running program - Flavio Copes
When working on a website locally, you use the command npm run dev to start the development server. This is a common practice...
Read more >The definitive Node.js handbook – Learn Node for Beginners
Node.js is a runtime environment for JavaScript that runs on the server. Node.js is open source, cross-platform, and since its introduction in ...
Read more >Let It Crash: Best Practices for Handling Node.js Errors on ...
Some strategies to gracefully shutdown the Node.js process and quickly restart your application after a catastrophic error terminates your ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
this command will tell you which program is using this port
and this will kill that process
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.