I have been working with a node.js project for a few weeks and it has been working great. Usually, I use npm start to run my app and view it in a browser on loc
npm start
Maybe you can take this as reference. This single command line can kill the process running on given port.
npx kill-port 3000
To kill multiple ports.
npx kill-port 3000 8080 4200