DEV Community

Discussion on: Something is already running on port 3000

Collapse
 
equuscaballus profile image
equuscaballus

I was wondering if there is any way to define the port number in the source code ? For example if I want to set a different port number for different project ?

Collapse
 
aledileo profile image
Alejandro Di Leo

It really depends on the server and implementation being used. For example if the project is using create-react-app, you can create a .env file with all your project based env variables. This is because create-react-app uses dotenv. If you can find this out or you're able to share the github repo I may be able to assist further

Thread Thread
 
equuscaballus profile image
equuscaballus

I just downloaded the projects form github randomly. couldn't find the repository URL. Do you know in which file of the source code the port number is defined ?

Thread Thread
 
aledileo profile image
Alejandro Di Leo • Edited

That also depends on the server being used. You can check the package.json file for more info, for example the scripts part. What is the value for the start command?

Thread Thread
 
equuscaballus profile image
equuscaballus

I will check that . you are very helpful . Thanks a lot :)