The Strapi interface works perfectly on the xxx.clusterxxx.hosting.ovh.net but when I run the yarn develop command to use Strapi it doesn’t work, an error appears: error Error: bind EACCES 0.0.0.0:1337
I tried several solutions from different forums (change the port, …) but nothing works, if someone has a solution?
The OP is asking for local development by using yarn develop, independently of the fact that might be using the wrong command in stage/production.
I’m having the same issue, my strapi develop command works like a charm in Ubuntu, but not for windows (I have two development PCs, one with Ubuntu/latest and other with Window 10).
Edit:
Despite the OP having used some kind of installation procedures aside from the officials, this error also happens on fresh installs.
It seems that the port 1337 is a protected port for windows, somehow. Try using the port 8082 for example, which is apparently free (Or any other higher like 8085).
You can just change your .env file to something like:
I had this issue aswell on my windows machine (develop). I tried to change the port in config/server.js but strapi admin panel still sent requests to port 1337. Therefore the login to the admin panel was not possible for me with this solution.
My solution to this problem was to figure out the process id with the command “netstat -ano | findstr :1337” in command prompt. With the output process id I went to the task manager and watched under the details tab which application corresponds to the process id. In my case it was the Razer Chroma app. After I uninstalled the razer App, I had no more issues with the port 1337 and could use strapi without problems
I can confirm, I have the exact same issue and Razer app was also using port 1337, uninstalled razer app and strapi worked. I also tried to change the port to something different but it kept trying to access the admin panel on port 1337 no matter what I put in the .env file (even though strapi was running on the port in the .env file it still tried to access the admin on 1337).
This is the problem with trying to be clever with your default ports: someone else already thought of it.
1337 is cool and all, but already in use, just like 5432 and 3306 etc. The latter ports were carefully chosen to avoid conflicts.
Using a round default number, above not just 1024, but 2048, like 3000 or 5000 should only conflict with with other local development projects that can be disabled.
All my projects that try a default port (usually 3000 and/or 3333), they recursively try/catch and generate a random port in the 20k ranges at least once or twice before actually failing so tests still work with the app running.
Sometimes it’s better to be compatible than clever.
I also tried using 3000 in the ENV file but the web app still looks at 1337… seems like only part of the app reads the env variable.
What is the solution here for developing locally on windows (other than uninstalling all my Razer software)?
Is there a fix planned for the PORT variable not working properly?
As a workaround I was able to:
shut down my Razer apps
open an admin PowerShell (req. for the last step)
netstat -ano | findstr :1337
taskkill /F /PID ( resulting PID from last command )
You’ll likely have to repeat steps 3 and 4 when the service gets relaunched.
Maybe it’s Hyper-V’s problem if you have installed something like docker in your windows PC.
Run netsh int ipv4 show excludedportrange protocol=tcp first to check the banned ports, if it includes 1337 port, then update it with netsh int ipv4 set dynamic tcp start=12345 num=53190, and reboot to make it work.