My project is based on create-react-app. npm start or yarn start by default will run the application on port 3000 and there is no option of specifying a port in the package.json.
How can I specify a port of my choice in this case? I want to run two of this project simultaneously (for testing), one in port 3005 and other is 3006
If you don\’t want to set the environment variable, another option is to change the scripts part of package.json from \”start\”: \”react-scripts start\”.\n\nTo Linux (test on Ubuntu 14.04/16.04) and MacOS (tested by aswin-s on Mac OS 10.12.4): \’start\’: \”PORT=3006 react-scripts start\”\n\nIsaacPak \”start\”: \”export PORT=3006 react-scripts start\” (or (may be) more general solution by Isaacpak: .\n\nWindows JacobEnsor\’s answer \”start\”: \”set PORT=3006 && react-scripts start\”\n\nAguinaldo Possatto\’s answer for details Update is popular in cross-env lib. Now I want to use environment variables saved in . Env file(useful to store sets of variables for various deploy configurations in an efficient and readable form) Don\’t add *.en V to a file file (assuming your secrets in the simplest and most cases) if you\’re still storing your files using environment variable. Here is the explanation for why?