When building my Vue development server (yarn serve
) each time I run it the port my project is being served on is incremented by 1 (3000 to 3001) each time I run yarn serve
I am also making sure to exit the previous process...
Is there any known reason this is happening? I've have tried searching for this but have seen nothing similar to this.
My package.json scripts block:
"scripts": {
"serve": "vue-cli-service serve --port 3000",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
}
This is probably because you still have a running service on the port
3000
, that's why it's incrementing itself. Try usingor
Then, you could kill it with specific CLI command or a basic
kill 11528
(kill
+ PID of the process). You could also use a SIGKILL withkill - 9 PID
if the process doesn't want to shutdown.PS: also, you should have a notice of it when you launch your server.