Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Port In Use code: 'EADDRINUSE', even after kill command

I have been running several MERN activities, one after another, working through exercises, but at some point when I run npm run develop, even thought I hit the kill command (trash icon) on mac, it tells me that something is still running on the port (3001), node crashes and then it starts, however only data from an older activity is rendered in the browser.

Here is the error;

Emitted 'error' event on Server instance at: [0]
 at emitErrorNT (node:net:1361:8) [0]
 at processTicksAndRejections (node:internal/process/task_queues:83:21) { [0]
code: 'EADDRINUSE', [0]   errno: -48, [0]   syscall: 'listen', [0]   address: '::', [0]   port: 3001`

Has anyone else experienced this problem and been able to fix it? Thank you.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I tried using the kill command trash icon. I made sure that I had used control c before killing the terminal.

It seemed to kill fine, and the subsequent activity seed ran without issue, but when I ran npm run develop, I got the error above, then it started successfully, but with only an older activity code and data.

>Solution :

In your CLI check which ports are running by typing lsof -i:[PORT].

Sub [PORT] with the port you are trying to run.
If it’s running grab the PID and use it in the below command:

kill -9[PID]

Hope that works!!

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading