2

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.

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.

1 Answer 1

1

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!!

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! I had to use the check command with tcp like this: lsof -i tcp:3001 but once I used this syntax I was able to grab the PID and run that kill command and that worked finally!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.