You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been running into issues with node --watch... here is why
node --watch is built into Node.js and watches for file changes, but it doesn’t always clean up the previous process properly, which can lead to that EADDRINUSE error.
Why?
node --watch restarts the server when changes happen, but sometimes the old process doesn’t fully release the port before the new one starts.
nodemon handles this better by properly shutting down the old instance before restarting.
Stick with nodemon
It’s just more reliable for restarting servers without causing port issues. But if you still prefer node --watch, you might need to manually kill the process sometimes (taskkill or kill -9 ).
UPDATE::
I have been running into issues with node --watch... here is why
node --watch is built into Node.js and watches for file changes, but it doesn’t always clean up the previous process properly, which can lead to that EADDRINUSE error.
Why?
node --watch restarts the server when changes happen, but sometimes the old process doesn’t fully release the port before the new one starts.
nodemon handles this better by properly shutting down the old instance before restarting.
Stick with nodemon
It’s just more reliable for restarting servers without causing port issues. But if you still prefer node --watch, you might need to manually kill the process sometimes (taskkill or kill -9 ).