I was having an issue with my Node server where it just wouldn’t start and constantly showed the following error:

Error: listen EADDRINUSE

This means that the node server is still running as a process (even if you can’t see it or thought you terminated it…).

The easiest way to resolve it? If you’re like me and on a Mac, type this:

ps aux | grep node

Then you’ll see a list like this:

patcat           393   1.9  0.0  3090752   1884 s001  S+    2:44pm   1:52.99 node /usr/local/bin/grunt
patcat           399   0.0  0.0  3058420      4 s000  S     2:44pm   0:00.59 node server.js
patcat          3523   0.0  0.0  2432768    596 s000  R+   12:07pm   0:00.00 grep node

The issue for me was server.js. So I found the process ID of 399 and ran this:

kill -9 393

Problem solved! You can now run your server happily once more!