i am testing a server written in nodejs on windows 7 and when i try to run the tester in the command line i get the following error
Error: listen EADDRINUSE
I have solved this issue by adding below in my package.json for killing active PORT - 4000 (in my case) Running on WSL2/Linux/Mac
"scripts": { "dev": "nodemon app.js", "predev":"fuser -k 4000/tcp && echo 'Terminated' || echo 'Nothing was running on the PORT'", }
Source