If I run a server with the port 80, and I try to use xmlHTTPrequest i get this error: Error: listen EADDRINUSE
Why is it problem for nodejs, if I want t
EADDRINUSE
means that the port(which we try to listen in node application) is already being used. In order to overcome, we need to identify which process is running with that port.
For example if we are trying to listen our node application in 3000 port. We need to check whether that port is already is being used by any other process.
$sudo netstat -plunt |grep :3000
That the above command gives below result.
tcp6 0 0 :::3000 :::* LISTEN 25315/node
Now you got process ID(25315), Kill that process.
kill -9 25315
npm run start
Note: This solution for linux users.