'Something is already running on port 3000
Solution 1:[1]
You can run this Command npx kill-port 3000 . This command keeps empty your 3000 port
Solution 2:[2]
I know this is late , but if anyone faces the same issue might want to try this
sudo kill -9 $(sudo lsof -t -i:9001)
where, 9001 is your port number.
Solution 3:[3]
You can either stop all your tasks running under Nodejs environment to make sure nothing is allocated on PORT 3000, or you can just modify the scripts part of package.json from:
"start": "react-scripts start"
to
"start": "PORT=3006 react-scripts start"
then run "npm start" on a new terminal session.
P.S. The second approach would be a bit of an overkill.
Solution 4:[4]
If your os is windows some processes (mostly hyper-v) may cause this problem by reserving some port ranges
you can see your reserved port ranges with this command
netsh interface ipv4 show excludedportrange protocol=tcp
If you see port 3000 is included in the list of reserved ranges you can solve the problem by excluding port 3000
command for excluding port 3000:
net stop winnat
netsh int ipv4 add excludedportrange tcp startport=3000 numberofports=1 store=persistent
net start winnat
then you may need to restart your PC
Solution 5:[5]
If you're using Linux, you can run the following commands on your console:
fuser -n tcp 3000
The command above will return the task ID of the program that is currently using the port. Then you will have to run
kill -9 [#task]
with the task ID. (Just replace all the '[#task]' by the task ID returned)
Solution 6:[6]
Use the command below:
You can run this Command npx kill-port 3000 . This command keeps empty your 3000 port
psmni@SuperManReturns MINGW64 /d/FSD/React/airbnb_psm (main) $ npm start
[email protected] start react-scripts start
Something is already running on port 3000.
psmni@SuperManReturns MINGW64 /d/FSD/React/airbnb_psm (main) $ npx kill-port 3000 npm WARN exec The following package was not found and will be installed: kill-port Process on port 3000 killed
psmni@SuperManReturns MINGW64 /d/FSD/React/airbnb_psm (main) $ npm start
[email protected] start react-scripts start
(node:10464) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
(Use node --trace-deprecation ... to show where the warning was created)
(node:10464) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
Starting the development server...
Compiled successfully!
You can now view airbnb_psm in the browser.
Solution 7:[7]
Launch Task Manager, find all the programs/tasks that are related Nodejs and stop them.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Munni |
| Solution 2 | Coderboi |
| Solution 3 | Sabbir Ahmed |
| Solution 4 | |
| Solution 5 | Zoe stands with Ukraine |
| Solution 6 | Prabha Shanker |
| Solution 7 | Brian Le |

