Febry Aryo
Febry Aryo

Reputation: 41

Error trying to running Express and Vue concurrently

My Vue app runs on port 8080. The setting of scripts: "serve": "vue-cli-service serve" and I start it up with yarn run serve.

My express server is set to run on port 4000. I start it up with yarn run dev with this scripts:

"client-install": "yarn add --prefix client",
"start": "node server.js",
"server": "nodemon server.js",
"client": "yarn start --prefix client",
"dev": "concurrently \"yarn run server\" \"yarn run client\""

while I try to run, it displays an error:

enter image description here

Upvotes: 0

Views: 163

Answers (2)

Febry Aryo
Febry Aryo

Reputation: 41

this problem's solve by using npm package called concurrently

Upvotes: 0

D. J. Wayne
D. J. Wayne

Reputation: 11

See what is already running on that port

netstat -a -n -o | find "4000"

TCP    127.0.0.1:4200         0.0.0.0:0              LISTENING       25160

get the pid, for example if pid is 25160 then

tasklist /fi "pid eq 25160"

node.exe                     25160 Console                    1    399,528 K

So then you can see what is using that port, in this case node. Also checkout this project: https://github.com/pietheinstrengholt/vue-express-boilerplate

Upvotes: 1

Related Questions