[BUG] Ctrl+c not killing running dev; leaving ports open
See original GitHub issueDescribe the bug
In the default next.js template from superplate, after I run the server with pnpm run dev
and use ctrl+c to stop it from running, upon re-running dev later, I see:
warn - Port 3000 is in use, trying 3001 instead.
This is because the first dev run was on 3000 and the node.exe process is still running. This problem never resolves.
Steps To Reproduce
Included
Expected behavior
Kills node process. Run on same port as before without having to go +1
Screenshot
No response
Desktop
node v18.12.1 LTS Windows 10
Mobile
No response
Additional Context
No response
Issue Analytics
- State:
- Created 9 months ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Ctrl + C Doesn't Kill Gracefully | Node v6.11.3 - Git Bash #16103
It completely skips app.listen() and exits completely, even when I previously kill the process on the specific port. Without the process.exit() ...
Read more >What to do when Ctrl-C won't kill running job? - Ask Ubuntu
Open Terminal → Preferences → Shortcuts and search if by mistake you have replaced any key with Ctrl + C . Share.
Read more >Node JS ctrl + C doesn't stop server (after starting server with ...
Ctrl + C does not kill the server. The resolution to the issue was using following code snippet in server.js:
Read more >What to do when Ctrl + C can't kill a process? - Super User
If that doesn't work, go to another terminal or SSH session and do kill or kill -TERM on the process ID. Only as...
Read more >Stop Node Server: How to kill a node process
While working on a full-stack application it might happen that you end up with a bunch of node processes running at the same...
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 FreeTop 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
Top GitHub Comments
Hey @omeraplak, I’ve patched @pankod/refine-cli and it works well with
windowsHide:false
also, I notice the terminal has no color, it works well withFORCE_COLOR=1 pnpm dev
Could you make the env variableFORCE_COLOR
enable by default These is execa options i’ve used:{ stdio:"pipe",windowsHide:false,env:{FORCE_COLOR:1,...process.env} }
Hi @drewbitt, Please, can you share
package.json
with us ?