Hi! Are you trying to run those few projects at the same time? If that's the case, it's possible that by default they will try to use that same port. Normally you can set PORT as an env variable to tell the project to run that specified port (this depends on the server being used). You can try running PORT=3001 npm start (or an equivalent to set env variables per command in your OS), changing the port value for each project
actually, you still didn't solve you problem, think how could you have been solved with changing the port, you should figure out, I am also facing same issue, but I also don't want to restart it and nor want to change the port
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 ?
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
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 ?
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?
Hi! Are you trying to run those few projects at the same time? If that's the case, it's possible that by default they will try to use that same port. Normally you can set
PORT
as an env variable to tell the project to run that specified port (this depends on the server being used). You can try runningPORT=3001 npm start
(or an equivalent to set env variables per command in your OS), changing the port value for each projectHi
Thanks for the reply. Actually now while running the project if I change the port number then it runs !
Thank you for your help :)
actually, you still didn't solve you problem, think how could you have been solved with changing the port, you should figure out, I am also facing same issue, but I also don't want to restart it and nor want to change the port
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 ?
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 becausecreate-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 furtherI 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 ?
That also depends on the server being used. You can check the
package.json
file for more info, for example thescripts
part. What is the value for thestart
command?I will check that . you are very helpful . Thanks a lot :)