DEV Community

Cover image for How To Handle `Error: EACCES: permission denied`
James 'Dante' Midzi
James 'Dante' Midzi

Posted on

How To Handle `Error: EACCES: permission denied`

The Occurrence

I'll be coding away, testing something, refactoring another or trying to figure out things on a dev server. I'll finish, then when I come back some time later and try to run a dev server and I am met with this error:

listen EACCES: permission denied 0.0.0.0:3000

This is on Windows

What Causes It?

I am actually stumped myself as:

  1. I have no clue what causes it and
  2. I don't know how to trigger it.

Most of the explanations point to something to do with Docker, but I do not have Docker installed. It must be something else that I can't seem to pinpoint.

The Solution

The best solution I have found to resolve this error is as follows:

  • Open PowerShell as Admin and stop winnat with the command below:
net stop winnat
Enter fullscreen mode Exit fullscreen mode
  • Start winnat again with the command below:
  net start winnat
Enter fullscreen mode Exit fullscreen mode

I have encountered this error enough times that I know the exact search term to find this solution. So rather than Googling the same thing over and over, I'll keep it here for quick access.


Might you know exactly what triggers it and how to avoid it in future? I would be very grateful for any explanation that makes sense.


My Suspicions

I got this error when I started the dev server with vs code's integrated terminal.

Recently as I have been defaulting to cmder, I haven't been getting it at all.

Might it be that vs code doesn't recognise that you have killed a server and started a new one? Who knows....


Thank you for reading, let's connect!

Thank you for visiting this little corner of mine. Let's connect on Twitter and LinkedIn>)

Top comments (1)

Collapse
 
gilachus profile image
gilachus

Arigatou