How to change the default port 3000 after creating a project with create-react-app?

The default port of the page that pops up after

1, npm install-g create-react-app
2, create-react-app my-app
3, cd my-app
4, npm start
is 3000. How to modify the default port? The server is not under the premise of this port number. Added:

to package.json
 "homepage": ".",
 "proxy":"http://localhost:8000", 
Mar.02,2021

"proxy":"http://localhost:8000", 

set the scripts "set PORT=3003&&react-app-rewired start" in package


windows environment "set PORT=3003&&react-app-rewired start"
mac environment "PORT=3003 react-app-rewired start"


Root directory to create a new .env.development file, add PORT=3001
, and 3001 is the port you want to change. Refer to " https://www.jianshu.com/p/195. "

Menu