Error: listen EADDRINUSE: address already in use :::5000
See original GitHub issuenodemon -v
: 2.0.7node -v
: 14.16.01- Operating system/terminal environment: MacOS Big Sur
- Using Docker? No
- Command you ran: nodemon server
Expected behaviour
Close port before reinitializing server.
Actual behaviour
[0] [nodemon] starting `node server.js`
[0] events.js:292
[0] throw er; // Unhandled 'error' event
[0] ^
[0]
[0] Error: listen EADDRINUSE: address already in use :::5000
[0] at Server.setupListenHandle [as _listen2] (net.js:1318:16)
[0] at listenInCluster (net.js:1366:12)
[0] at Server.listen (net.js:1452:7)
[0] at Function.listen (/Users/tf/Documents/courses/MERN/server/node_modules/express/lib/application.js:618:24)
[0] at Object.<anonymous> (/Users/tf/Documents/courses/MERN/server/server.js:35:5)
[0] at Module._compile (internal/modules/cjs/loader.js:1063:30)
[0] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
[0] at Module.load (internal/modules/cjs/loader.js:928:32)
[0] at Function.Module._load (internal/modules/cjs/loader.js:769:14)
[0] at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
[0] at internal/main/run_main_module.js:17:47
[0] Emitted 'error' event on Server instance at:
[0] at emitErrorNT (net.js:1345:8)
[0] at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'EADDRINUSE',
[0] errno: -48,
[0] syscall: 'listen',
[0] address: '::',
[0] port: 5000
[0] }
[0] [nodemon] app crashed - waiting for file changes before starting...
Steps to reproduce
- Initialize app (basic MERN app)
- Save any file.
- Error is thrown.
This only started happening after I updated my Mac to Big Sur. I can circumvent this issue by either stopping the app and killing the port or by saving a second time a couple of seconds after the first crashed the server.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:20 (3 by maintainers)
Top Results From Across the Web
Node / Express: EADDRINUSE, Address already in use - Kill ...
First, you would want to know which process is using port 3000 sudo lsof -i :3000. this will list all PID listening on...
Read more >How to kill server when seeing “EADDRINUSE: address ...
Nodejs listen EADDRINUSE: address already in use. The Problem. When trying to restart a Node application, the previous one did not shut down ......
Read more >Node.js Error: listen EADDRINUSE: Address already in use
This quick article shows you how to solve a common error you might confront when working with Node.js. The Problem When developing a...
Read more >Node.js – listen EADDRINUSE: address already in use :::5000
Node.js – listen EADDRINUSE: address already in use :::5000. node.jsnpm. In my application, I use concurrently to run both backend and front end ......
Read more >How To Solve "EADDRINUSE - Address Already In Use"
If you ever run into this problem, you have 2 options: Run your application on a different port, or; Terminate the existing process....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve found a temporary work-around, the steps for which are listed below:
npm install -D kill-port
All credit goes to Tudor Constantin on Stack Overflow. However, it is a bit tedious and definitely a workaround, not something that should be done for all future Node.js projects.
Okay, start striping the code back until you have the bare minimum and you can still replicate, then post that here, then we can take a look.