Xdn run error: Error: listen EADDRINUSE: address already in use :::3000

I receive the following error when using xdn run

Running MOOVWEB XDN in development mode with caching disabled
throw er; // Unhandled ‘error’ event

Error: listen EADDRINUSE: address already in use :::3000
    at Server.setupListenHandle [as _listen2] (net.js:1313:16)
    at listenInCluster (net.js:1361:12)
    at Server.listen (net.js:1447:7)
    at Function.listen (/Users/ankur.kumar/Desktop/vue-app/router-app/node_modules/express/lib/application.js:618:24)
    at promises (/Users/ankur.kumar/Desktop/vue-app/router-app/node_modules/@xdn/core/server/createDevServer.js:124:34)
    at new Promise (<anonymous>)
    at Object.createDevServer [as default] (/Users/ankur.kumar/Desktop/vue-app/router-app/node_modules/@xdn/core/server/createDevServer.js:122:9)
    at Object.<anonymous> (/Users/ankur.kumar/Desktop/vue-app/router-app/node_modules/@xdn/core/bin/run.js:12:26)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
Emitted 'error' event on Server instance at:
    at emitErrorNT (net.js:1340:8)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  code: 'EADDRINUSE',
  errno: 'EADDRINUSE',
  syscall: 'listen',
  address: '::',
  port: 3000
Error: Process exited with code 1
    at ChildProcess.<anonymous> (/Users/ankur.kumar/Desktop/vue-app/router-app/node_modules/@xdn/cli/utils/run.js:30:16)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

Seems like there is another program which is running at the port 3000, which is the default port for XDN applications.

Use netstat or lsof to identify the program

netstat -vanp tcp | grep 3000
sudo lsof -i tcp:3000

Kill the process using kill -9 <PID>, and then try running xdn run

We also use kill-port in our team: https://www.npmjs.com/package/kill-port. It makes the whole process one simple kill-port 3000.