0

I never get problem with the MERN stack, but it's the first time than i use typeScript.

I encountered an issue when starting my server.

when I run npm run dev, a new error occurs: Error: listen EACCES: permission denied 5000. I've tried different ports, but the error persists...

What could be causing this permission issue, and how can I resolve it?

It's worth noting that I tried opening Express with older projects, and it works fine. So, the issue doesn't seem to be related to my firewall.

What could be causing this permission issue, and how can I resolve it?

You can check my code on GitHub

asked Sep 18, 2023 at 16:40
2
  • Did you try port 8050? Btw, put .env on your .gitignore. Commented Sep 18, 2023 at 16:43
  • Yes i tried port 8050, 8080, 3000, 5000 ... Thanks for the .env in the .gitignore Commented Sep 19, 2023 at 12:55

1 Answer 1

1

Your .env file must use this format:

Correct:

PORT=8050

Incorrect:

PORT = 8050;

Do not include semicolons or spaces in your .env file.

answered Sep 20, 2023 at 3:21
Sign up to request clarification or add additional context in comments.

1 Comment

Also, your .env should not be visible in github. Unless you have made it available to us for solving this problem, it should be listed in your .gitignore file so that your secret keys are not exposed

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.