终止 Vue CLI 3 开发服务器的正确方法是什么?

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

我刚开始为一个项目使用 Vue CLI 3,看起来我没有正确终止开发会话。喜欢 the docs suggests 我开始开发会话:

npm run serve

这给了我工作的端口:

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

当我完成我的项目时,我点击了 Ctrl-Z,我的命令行又回来了。耶!

但这留下了一些东西仍在监听端口:

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

如何优雅地终止开发服务器,以便它在我完成后释放端口?

请尝试使用 Ctrl-C。它允许应用程序正常关闭。