Run it as sudo i.e.
sudo node server.js
I just spent over 10 minutes looking around the internet for this simple solution. Hopefully, this post will save somebody some time 🙂
P.S. Check out: Programming Interviews Exposed: Secrets to Landing Your Next Job.
Are you hiring? My good friend is looking for work.