“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


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.

Related Posts

Leave a comment

Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Privacy Preferences
When you visit our website, it may store information through your browser from specific services, usually in form of cookies. Here you can change your privacy preferences. Please note that blocking some types of cookies may impact your experience on our website and the services we offer.