When I try to run the server by writing 'npm start' on the terminal, it's giving me the below error. As I am following the video series and stuck in part 15. Anyone who knows how to get rid of that?
events.js:187
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use :::5000
at Server.setupListenHandle [as _listen2] (net.js:1301:14)
at listenInCluster (net.js:1349:12)
at Server.listen (net.js:1437:7)
at Function.listen (F:\MernStack\parsell\node_modules\express\lib\application.js:618:24)
at Object. (F:\MernStack\parsell\backend/server.js:35:5)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Module._compile (F:\MernStack\parsell\node_modules\pirates\lib\index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Object.newLoader [as .js] (F:\MernStack\parsell\node_modules\pirates\lib\index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at Object. (F:\MernStack\parsell\node_modules@babel\node\lib_babel-node.js:180:21)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
Emitted 'error' event on Server instance at:
at emitErrorNT (net.js:1328:8)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'EADDRINUSE',
errno: 'EADDRINUSE',
syscall: 'listen',
address: '::',
port: 5000
}
[nodemon] app crashed - waiting for file changes before starting...
The port 5000 is already in use, so you have to kill the process which is using this port.
Search for command to kill the process of port number 5000, and after it, you can start your backend on this port.
@Faiqa123 @jitendrasuthar1998 FYI that this stackoverflow topic helped resolve this issue for me: https://stackoverflow.com/questions/69868760/m1-mac-process-keeps-autogenerating-and-locks-my-port