“Cannot read property ‘getsockname’ of undefined” in your stack trace?

If you see this in your stack trace while trying to start your node app..

TypeError: Cannot read property 'getsockname' of undefined

You might probably want to check if port/s your app is supposed to be using are being used by something else.

For example, your app uses port 80. You can check if that port is being used (via the terminal/command prompt):

UNIX (Linux/Mac):

sudo lsof -i:80

Windows:

netstat -an | find ":80"

If nothing shows up when you do those commands, the ports are open.

If something shows up, then the port’s being used. You know what to do.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.