Error: listen EADDRINUSE
bbdwbayu opened this issue · 1 comments
Hello, so im using node v16 and py 3.9. i already build the server and ui. when i want to start both of them it says
PS C:\httptoolkit\httptoolkit-ui> npm start
httptoolkit-ui@0.1.0 start
npm-run-all --parallel --print-label start:server start:web[start:web ]
[start:web ] > httptoolkit-ui@0.1.0 start:web
[start:web ] > env-cmd -f ./automation/ts-node.env webpack-dev-server --config ./automation/webpack.dev.ts
[start:web ]
[start:server]
[start:server] > httptoolkit-ui@0.1.0 start:server
[start:server] > node ./node_modules/httptoolkit-server/bin/run start
[start:server]
[start:server] Config checked in 38 ms
[start:server] Certificates setup in 19 ms
[start:server] Error: listen EADDRINUSE: address already in use 127.0.0.1:45456
[start:server] at Server.setupListenHandle [as _listen2] (node:net:1463:16)
[start:server] at listenInCluster (node:net:1511:12)
[start:server] at doListen (node:net:1660:7)
[start:server] at processTicksAndRejections (node:internal/process/task_queues:84:21) {
[start:server] code: 'EADDRINUSE',
[start:server] errno: -4091,
[start:server] syscall: 'listen',
[start:server] address: '127.0.0.1',
[start:server] port: 45456
[start:server] }
[start:server] Error: listen EADDRINUSE: address already in use 127.0.0.1:45456
[start:server] Code: EADDRINUSE
Thank you
This means there's two servers trying to run at the same time. That either means that you've started two servers at the same time yourself, or that you've launched a server somewhere else before (e.g. within the normal HTTP Toolkit app) and it hasn't exited correctly at the end.
In general, if you want to independently run the UI and the server (e.g. to use a separate local development version of both, instead of the official releases) then you want to run npm run start
in the server repo, and npm run start:web
here in the UI. That will start each one independently, without starting two servers at the same time. There's instructions on this in the README.
Does that work for you?