Skip to content
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

how change port #3513

Closed
Statfine opened this issue Nov 28, 2017 · 8 comments
Closed

how change port #3513

Statfine opened this issue Nov 28, 2017 · 8 comments

Comments

@Statfine
Copy link

how can i change port 3000 to 3001

@Yonben
Copy link

Yonben commented Nov 28, 2017

Quick search: #1083

@Statfine
Copy link
Author

@Yonben Right, thanks

@katakeynii
Copy link

In your console run PORT=3001 yarn start

@diptiborade
Copy link

change port in console before running
SET PORT=3100

then run the command
npm start

On my pc:

E:\ReactJs\reactapp2>SET PORT=3100

E:\ReactJs\reactapp2>npm start

reactapp2@0.1.0 start E:\ReactJs\reactapp2
react-scripts start

Compiled successfully!


@Hashmat2526
Copy link

i searching and reading number of comments..! this is so simple and successful

@mikaelfs
Copy link

mikaelfs commented Aug 3, 2018

I documented the various options one can choose in order to change the default port. You can set the environment variable as shown in the comment above, change the start command, or create .env file. Here is the full article.

@jsina
Copy link

jsina commented Aug 26, 2018

Windows users change the script like this:
"scripts": { "start": "set PORT=5000 && react-scripts start",

and Linux and Mac users like this:
"scripts": { "start": "PORT=5000 react-scripts start",

@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants