New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm start use hostname instead of localhost on Linux #2954
Comments
The If that works, create a
You can now run To achieve the default CRA behavior, use |
@Timer Thanks! This works. I do not know why the $HOST variable is not updated after I changed my hostname and rebooted the system. |
You might want to check your |
About .env file, it doesn't really support Linux system variable. Only those variables started with
|
Ah yes, it does support Maybe we can add a force overwrite... |
You could add an entry in your |
My laptop uses openSUSE Linux with hostname "Guos-Kudu". When I created a react app and run
npm start
, it opens http://guos-kudu:3000 in browser. When I visit http://localhost:3000 it cannot be accessed.Some HTTP API only allows localhost to access. Or the API administrator only enabled localhost in OAuth configuration. In this situation, a non-standard URL will have many troubles.
Even when I changed the hostname to
localhost
or remove it, react-scripts still looks for http://guos-kudu:3000 instead of localhost. Have no idea what caused this.The text was updated successfully, but these errors were encountered: