question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Ctrl+c not killing running dev; leaving ports open

See original GitHub issue

Describe 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:closed
  • Created 9 months ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
yasnbouzcommented, Dec 22, 2022

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 with FORCE_COLOR=1 pnpm dev Could you make the env variable FORCE_COLOR enable by default These is execa options i’ve used: { stdio:"pipe",windowsHide:false,env:{FORCE_COLOR:1,...process.env} }

1reaction
alicanerdurmazcommented, Dec 9, 2022

Hi @drewbitt, Please, can you share package.json with us ?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found