Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"EADDRINUSE :::#port" while saving #826

Closed
aleskozina opened this issue Jun 29, 2018 · 6 comments
Closed

"EADDRINUSE :::#port" while saving #826

aleskozina opened this issue Jun 29, 2018 · 6 comments

Comments

@aleskozina
Copy link


[ ] Regression
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request

Current behavior

npm run start:dev starts as expected the watcher and compiles the changes. After a while (i assume, if you save to frequently in short time) the watcher (nodemon) raises the error EADDRINUSE. After restarting the server, the error persists. I have to change the port in the main file.

Expected behavior

Well, the watcher should not throw this error :-)

Minimal reproduction of the problem with instructions

  • run npm run start:dev
  • make changes
  • save
  • server restarts

do two saves quickly and you should get the error.

What is the motivation / use case for changing the behavior?

Proper testing environment

Environment


Nest version: 5.0.1
 
For Tooling issues:
- Node version: 8.11.3 (LTS)
- Platform:  OSX: 10.13.5

@kapv89
Copy link

kapv89 commented Jun 30, 2018

I have also faced this bug. However, I'd suggest that instead of changing the port each time you face EADDRINUSE error, you should kill the process that is currently binding to the old port. Because if you don't do so, you'd be left with a zombie nestjs process for each time you change the port, which is never a good thing to have.

On Ubuntu, I'd do the following:

  • lsof -i tcp:3000 -- this gives you the process id listening
  • kill -9 <processId>

Since OSX is also a "nix", the above commands should work on it too.

@unlight
Copy link

unlight commented Jul 1, 2018

What repository are you using?
What is watch program under the hood: nodemon, nodedev, webpack?

@aleskozina
Copy link
Author

aleskozina commented Jul 2, 2018

@kapv89 I have figured this out by myself, too. It was too annoying to change the port in the rest-client, too.

@unlight
Q 1 What exactly too you mean? Im using the latest nest project as base (created via nest-cli). No special configs.
Q 2 Well, i think its nodemon but this configuration also comes from nest. If you are interested in config files, i assume you can just hook into the nest repository. Hopefully this answers your question.

kr
Ales

@kamilmysliwiec
Copy link
Member

I don't this is related to the Nest package. Consider reporting this issue in the appropriate repository (nodemon?)

@zverbeta
Copy link

zverbeta commented Dec 8, 2018

@lock
Copy link

lock bot commented Sep 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants