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

How to stop server? #14

Closed
vko-online opened this issue Jan 10, 2015 · 7 comments
Closed

How to stop server? #14

vko-online opened this issue Jan 10, 2015 · 7 comments

Comments

@vko-online
Copy link

Everytime i start it, it throws error, Address in use, Don't want to change port everytime =(

@typicode
Copy link
Owner

What's your OS?

@typicode
Copy link
Owner

Actually ctrl-C should be enough. But if it says Address in use, you already have a process listening on port 3000.

It may be another instance of jsonplaceholder or some other development server (since port 3000 is quite common).

You should try to find if there's already a running jsonplaceholder server and kill it. Or if you have a server listening on port 3000, start jsonplaceholder on another port.

@vko-online
Copy link
Author

I attached it to gulp serve, gulp port 3000, json-server port 9000 but it doesnt increase port itself as gulp does, is there any command to shutdown server by script? So when i press Ctrl+C, json-server will shutdown with gulp serve

@gunjot-mansa
Copy link

Hi @vko-online ,

Did you get any answer for this?

@Ashish0019
Copy link

Ashish0019 commented Mar 21, 2017

I faced the same issue i forgot toctrl+c, before closing the terminal, now it's giving EADDRINUSE for the same port.
how to stop this server manually
some alternative for ps aux | grep gulp in mac OS

Don't wanna change port or restart the system

@dmbdesignpdx
Copy link

Not sure if this too late or if this is even the solution to the problem you are experiencing, but here it goes:

If this is the error you're getting or something similar:
Error: Address already in use - bind(2)

Type in the command line:
lsof -wni tcp:[port]
where [port] is the port number that's in conflict

If that port is in conflict, there should be list of one or more uses. To stop them, type
kill -9 [PID]
where [PID] is the process ID indicated by the column title "PID".

That should do it.

@typicode
Copy link
Owner

Thanks for the answers @Ashish0019 and @dmbdesignpdx, didn't know about lsof -wni tcp:[port] 👍 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants