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

1

8

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?

Damascus answered 21/9, 2018 at 9:16 Comment(3)
Try using Ctrl-C instead. It allows the application to gracefully shut down.Forefather
Okay! Learning new things every day. @Forefather can you please add your comment as an answer so I can accept it. BTW, how did you know this?Damascus
I always used Ctrl-C. A while ago Ctrl-Z was actually a TIL for meForefather
F
9

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

Forefather answered 21/9, 2018 at 13:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.