Node server snooping error problem

server.on("error", onError);

if an error Error: listen EADDRINUSE: 4000 indicates that port 4000 is occupied, how can I use code execution to close the application that kills the currently occupied port if I hear that EADDRINUSE, does not enter the command line or task management in the onError event?

Apr.26,2021

  1. netstat-ano | findstr 4000 query the PID; occupied by port 4000
  2. assume 3015;
  3. taskkill / pid 3015
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb2245-23ae.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb2245-23ae.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?