How to change port in React JS | Change default localhost 3000 port

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey hello everyone in this video i will  be showing you how to change the default   port from 3000 to your choice in react.js so  currently i'm having a react project which is   currently running at localhost 3000 so i'll be  showing you how to change your desired port okay   so first thing what you'll do is you  want to stop the running project so   just go to the command prompt and just  type control c okay and just hit y okay   just stop the running project okay and then what  you'll do is you have to go to the package.json   it's not package log.json it's package.json just  click it and you need to just open it over here   and here we'll be having start okay start key  under scripts okay so what you'll do is inside   this double quote you need to add this particular  line it's going to be set port in capital letters   equal to 3008 so this is where you can specify  your desired port number or your choice   and you need to put this ampersand symbol  twice or and symbol twice and after adding   this particular line save it okay control s really  important to save it okay if you don't save your   changes won't be getting effected okay so after  just adding this line you can just close your   package.json and you can just come to a terminal  okay and you can just hit npm start and hit enter so now as you can see here our react project is  getting started and you can see our port is now   3008 so react project has now successfully  started if i just now go to the browser   so as you can see here i'm having local lost 3008  over here and my project is currently visible   and if i go to that local host 3000 i will be  getting page isn't working right now so this isn't   running in port 3000 it's running in my port okay  3008 over here and you can just go to some other   browser and you can also check it it's running in  localhost 3008 port so this is a simplest way of   changing the port for your react.js project and  i hope you found this video useful i have also   done many other programming videos in c c plus  plus java python as well as 3d animation in   blender so do check other videos of my channel  subscribe and support me thanks for watching
Info
Channel: United Top Tech
Views: 31,274
Rating: undefined out of 5
Keywords: how to change port in react js, change localhost port react js
Id: _JFTk91fvMY
Channel Id: undefined
Length: 2min 6sec (126 seconds)
Published: Tue Feb 22 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.