node Error: listen EACCES: permission denied ON ANY PORT [Windows]

8,746

It turns out that my .env file is incorrect. You should not put ',' separator between the variables.

Share:
8,746

Related videos on Youtube

Anzhelo Petkov
Author by

Anzhelo Petkov

Updated on September 18, 2022

Comments

  • Anzhelo Petkov
    Anzhelo Petkov over 1 year

    Here is the code that have the issue with: link. Anyway I don't think the problem is in the code itself. There are a lot of articles on the internet about this issue but none of them helped so far. And I spent like 2 full days digging into this issue.

    1. The port that I'm trying with is high like above 8000.
    2. When I check the availability of that port its available.
    3. I also tried running my server on two separate machines and the same error pops.
    4. Tried by running 'npm start' in cmd with admin permissions - same error.
    5. Restarted the machines several times - waste of time.
    6. As you can see I'm not making that mistake of swapping the port with the host.
    7. There were people saying that the user that executes the command usually dont have permissions and that's why the problem appears.Here you can see that I have full permissions.

    I'm really desperate at this point. I was even thinking about buy a new laptop but when I checked on the second machine I realized that this will not fix the issue.

    • fixer1234
      fixer1234 almost 5 years
      Your first link is dead, so people can't see the context of your question. Without that, your answer is kind of a non sequitur. Your second link is still there, but at a third-party site and may not continue to be available. Please make the question self-contained by including the essential information within the question.
    • Guus Baggen
      Guus Baggen about 4 years
      If you've installed docker using windows containers, this might help: superuser.com/a/1288756/769411 This solved it for me (disabling hyper-v, reboot).
  • Antfish
    Antfish about 4 years
    Not sure why this has been downvoted, it is the correct answer. I had the same problem but I was using a semicolon after each value, So instead of the value being read as "3000" it was read as "3000;" which errors.
  • Dheeraj
    Dheeraj over 3 years
    worked! maybe the downvotes were because you did't give a detailed explanation
  • robross0606
    robross0606 about 3 years
    This problem occurs on Windows regardless of .env settings. For many, it is caused by a Windows WSL2 Hyper-V bug that locks port access.