how can i change port 3000 to 3001
@Yonben Right, thanks
In your console run PORT=3001 yarn start
change port in console before running
SET PORT=3100
then run the command
npm start
E:\ReactJs\reactapp2>SET PORT=3100
E:\ReactJs\reactapp2>npm start
[email protected] start E:\ReactJs\reactapp2
react-scripts start
Compiled successfully!
i searching and reading number of comments..! this is so simple and successful
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.
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",
Most helpful comment
In your console run
PORT=3001 yarn start