While working on the backend for a game app I continually run into the error EADDRINUSE: address already in use. My only option when this happens is to completely stop and re-build the app.
Specifically, this is a big problem when I am testing/playing with changes made to the game. Ex: load up the game on local, make an edit in the code, server automatically restarts when code is edited, test changes in game, edit code again to tweak it, reload, etc... When I am in this development loop (almost constantly restarting the server on local) it doesn't take long before I run into this issue. Any solutions?
Possibly Related Packages:
Node.js: v12.16.3
"ws": "6.2.1",
"typescript": "^3.9.6",
"express": "4.17.1",
"nodemon": "1.18.9",
"ts-node": "7.0.1",
I use nodemon with ts-node app.js command to run the server.