I have been working with a node.js project for a few weeks and it has been working great. Usually, I use npm start
to run my app and view it in a browser on loc
I have spent 2h on finding out why EADDRINUSE
wasn't allowing me to sart an app (other node-express servers were ok)... it started working after adding
lazyConnect: true,
to datasource configuration.
Don't ask me why it helped. I do not know. I am putting this info here just for people having the same issue.
In ubuntu first grab the process by using port number: sudo lsof -i:3000 then use kill command to kill the process, for example if the process PID is 4493 the use command: kill 4493 , for mac or windows find the related command
It may be an admin process running in the background and netstat
doesn't show this.
Use tasklist | grep node
to find the PID of this admin process and then kill PID
For windows, The Task Manager would definitely show a node process running. Try to kill the process, it will solve the problem.
Maybe you can take this as reference. This single command line can kill the process running on given port.
npx kill-port 3000
To kill multiple ports.
npx kill-port 3000 8080 4200
I had the same problem. (The below steps work fine on Windows 10):
Now you can run npm start
.
Hope it helps you.