Port switching
See original GitHub issueFeature request
When we run next dev
command then before starting the server next
should check for a port number 3000 is available or not if not then next
should be switch to another port instead of throwing Port 3000 is already in use.
error.
Is your feature request related to a problem? Please describe.
If port 3000 is locked due to another process then I’ve kill running process on port number 3000 or need to pass a port number with -p to next dev
command. In my point of view, next
should be switch to an available port number instead of throwing error.
Describe alternatives you’ve considered
There are two ways either you’ve to manually close port number forcefully or you’ve to pass a port number to next dev
command.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Definition of port switching hub - PCMag
An intelligent network hub that attaches to multiple LAN segments. Via software, it allows the station ports to be connected to one of...
Read more >What Is a Switch Port? Types & Configuring (with pictures)
On a network switch, the switch port is the physical opening where a data cable can be plugged in. Generally, switch ports are...
Read more >Different Types of Switch Ports - GeeksforGeeks
Network devices connect to a switch through its switch ports. Switch Ports which are physical opening where data cables are plugged in to ......
Read more >Switch Ports, Port Managers | Comms InfoZone
A switch maintains the MAC addresses of its connected devices and knows into which port a transmission should be directed. Small business switches...
Read more >Network switch - Wikipedia
Unlike repeater hubs, which broadcast the same data out of each port and let the devices pick out the data addressed to them,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I like the
create-react-app
approach.If I run a
create-react-app
app before a Next project, it will start on port 3000, then when I runnpm run dev
on my Next project, it gives mePort 3000 is already in use.
BUT, if I start my Next project before it, it takes the port 3000 and when I start
create-react-app
it alerts me (@jkjustjoshing would still be told that there is something running there) and gives me the opportunity to start the project on another port:I’ve found that most of the time when port 3000 is in use already, it’s because I have my Next.js app already running in a different terminal window, and I appreciate being told about the issue instead of just moving to a different port.
How frequently do you have this issue? Sounds like you should just permanently change the port you develop your Next.js app on by updating your
package.json
: