React: Change Port Number for a create-react-app Website

2/15/2021 10:46:31 PM

To run a create-reat-app on a different port, you need to update the package.json file. The following sets the port to 4001.


{
	...
		
    "scripts": {
        "start": "set PORT=4001 && react-scripts start",		
		"build": "react-scripts build",
		"test": "react-scripts test",
		"eject": "react-scripts eject"
    },
    
	...
}