What is the proper way to terminate the Vue CLI 3 development server?

Jannie Theunissen picture Jannie Theunissen · Sep 21, 2018 · Viewed 6.9k times · Source

I have just started to use Vue CLI 3 for a project and it looks like I am not terminating a development session correctly. Like the docs suggests I start a development session with:

npm run serve

Which gives me the port to work on:

App running at:
- Local: http://localhost:8087/
- Network: http://192.168.0.100:8087/

When I'm done working on my project I hit Ctrl-Z and I have my command line back. Yay!

But this leaves something still listening on the port:

lsof -i TCP:8087
COMMAND   PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
node    58122 jannie   14u  IPv4 0xc7ce0b7d644a357d      0t0  TCP *:8087 (LISTEN)

How can I terminate the development server gracefully so that it frees the port when I am done?

Answer

ikkentim picture ikkentim · Sep 21, 2018

Try using Ctrl-C instead. It allows the application to gracefully shut down.