Running App when the port is busy
See original GitHub issueIs this a bug report?
Yes
Environment
- Operating system: MacOS
- Node v9.4.0
- npm 5.6.0
- Terminal: iTerm2 (with http://ohmyz.sh/)
"react-scripts": "1.1.0"
Steps to Reproduce
- Open a Tab in your Terminal
- Run app
xxx
in port 3000 - Open another terminal
- Run app
yyy
in port 3000. - The app
yyy
should let you know that the port is busy (now, read the Expected Behavior)
Expected Behavior
You should see the question “Would you like to run the app on another port instead?” in app yyy
If you answer No
, the process should quit (the process of app yyy
).
Actual Behavior
? Something is already running on port 3000. Probably:
node scripts/start.js (pid 63408)
in /Users/noel/xxxx/xxx
Would you like to run the app on another port instead? No
The process is not killed, and you have to do it manually.
This is a YouTube video of the bug: https://youtu.be/n9IQ8H2TfQA
package.json
:
{
"name": "indiebiz-frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"cross-env": "^5.1.3",
"node-sass-chokidar": "0.0.3",
"npm-run-all": "^4.1.2",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-router-dom": "^4.2.2",
"react-scripts": "1.1.1"
},
"scripts": {
"build-css": "node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/",
"watch-css": "npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/ --watch --recursive",
"start-js": "react-scripts start",
"start": "npm-run-all -p watch-css start-js",
"build-js": "react-scripts build",
"build": "cross-env NODE_PATH=src npm-run-all build-css build-js",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
keep getting "? Something is already running on port 3000 ...
js app, and it was successfully launch on port 3000 while React said there is something running on 3000. React on my computer...
Read more >Fs_clone ERROR : port 17021 is BUSY - My Oracle Support
Oracle Applications DBA - Version 12.2.8 and later: Fs_clone ERROR : port 17021 is BUSY.
Read more >How can I check if an application is listening on a port ... - IBM
In order to check which application is listening on a port, you can use the following command from the command line: For Microsoft...
Read more >Determining if a port is in use by an application or process on ...
Checking port usage from Windows · Start Task Manager by pressing Ctrl+Shift+Esc · Click on the Processes tab and click View then Select...
Read more >TCP/IP port exhaustion troubleshooting - Windows Client
Ephemeral ports, which are dynamic ports, are the set of ports that every machine by default will have them to make an outbound...
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
@BrodaNoel This is because
npm-run-all -p
runs the processes in parallel using separate processes. Thereact-scripts
command correctly kills its own process, but the other watch process is still running in a separate process without exiting.To make it work correctly, use the
race
option of npm-run-all, that’ll terminate both processes when either exits.Changing your script to
npm-run-all -p -r watch-css start-js
should fix it.Closing this issue since it isn’t a problem with Create React App.