-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
Change default port behavior #353
Comments
@ThomasG77 it is because you are adding parameter to npm not its script To let npm pass arguments to script, you'll need to add a Like this: |
Thanks @richardzcode for the answer but it's not the issue: I already mentioned your solution in the issue description. I do not care about option |
Is this generally what people expect to happen. Does create-react-app fall-up to 3001 when 3000 is used? |
@neilsutcliffe FYI, it uses PORT env variable https://github.com/facebookincubator/create-react-app/blob/master/CONTRIBUTING.md#heuristics |
@ThomasG77 Hi. I think this is more a feature request than a bug since you can accomplish the same thing with the command line option. But I see your point in allowing an environment variable as well. |
Closed in #516 , thanks @InternetExplorer7 for the feature! |
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Steps to Reproduce
When I run
npm run start
from step 4 of https://docusaurus.io/docs/en/site-preparation.html#verifying-installation, I encounter following message (as I have another server running on 3000)I tried to do
PORT=3001 npm run start
and it fails.I've seen that I can set port using
--port 3001
at https://github.com/facebook/Docusaurus/blob/master/lib/start-server.js#L34Expected Behavior
I would expect that if port 3000 is not available, it would automatically switch to PORT number + 1 (like
http-server
does)I would also expect
PORT=3001 npm run start
should not fail.Actual Behavior
The command line does not switch port automatically
Environment variable PORT is not supported but it should IMO as I consider that it's default setting in most Node projects.
The text was updated successfully, but these errors were encountered: