Error: listen EADDRINUSE: address already in use 0.0.0.0:80
code: 'EADDRINUSE', errno: -4091, syscall: 'listen', address: '0.0.0.0', port: 80 getting these error while running the command "npm run env-debug"
how can I resolve these.
Error: listen EADDRINUSE: address already in use 0.0.0.0:80
code: 'EADDRINUSE', errno: -4091, syscall: 'listen', address: '0.0.0.0', port: 80 getting these error while running the command "npm run env-debug"
how can I resolve these.
It's because the port 80 is typically reserved for tcp and http communication. Use different ports like 5000, 3000 etc.
See details here Wikipedia port 80
One of the processes is using port 80. Also, it depends on the OS. Generally, you can not access ports below 1024 without root or admin authorization.
Check which process is using port 80. Most web servers use 80 ports like apache or Nginx.
Windows: Check Ports
Linux: Check Ports
Kill the process using port 80 and you are good to go if you have root privileges.
But, you should never run the node.js app on port 80 with root privileges. It is not recommended to run any server software as root. Run your app on some other port like 80 and use a reverse proxy like Nginx to map it.