ReduxSimpleStarter
ReduxSimpleStarter copied to clipboard
can't run the project
I ran "npm start" and got this:
> [email protected] start /Users/roytzur/react-redux tutorial/ReduxSimpleStarter
> node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js
events.js:160
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 127.0.0.1:8080
at Object.exports._errnoException (util.js:1008:11)
at exports._exceptionWithHostPort (util.js:1031:20)
at Server._listen2 (net.js:1253:14)
at listen (net.js:1289:10)
at net.js:1399:9
at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:65:16)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:84:10)
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.3.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the redux-simple-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs redux-simple-starter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls redux-simple-starter
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/roytzur/react-redux tutorial/ReduxSimpleStarter/npm-debug.log
Please help me find out what's wrong. thanks
There are some options to try here - https://github.com/StephenGrider/ReduxSimpleStarter/issues/22
I had the same errors you're getting. What worked for me was to run 'npm install' from the project directory then try 'npm start' again. I thought I installed npm globally but I guess I needed to add it to my specific project. Good Luck!
I came across this issue as well and I think i know what's going on.
At the time of Stephen recording this tutorial he was using the 4.x.x of node. However some people have 6.x.x installed. The version difference between the two must have introduced a breaking change which stops the build.
I didn't really want to remove node 6.x.x to get the build to work so I would say that people look at using nvm
which allows you have multiple versions of node installed and you can then seamlessly switch between the 4.x.x and 6.x.x. Doing this I was able to switch to 4.x.x and have the build working without any problems.
https://github.com/creationix/nvm
This is the problem:
Error: listen EADDRINUSE 127.0.0.1:8080
Another app is already listening on this port. (check on cmd with: netstat -ano)
To resolve, go to: ..\ReduxSimpleStarter\node_modules\webpack-dev-server\bin\webpack-dev-server.js
and change the port from this line of code to whatever free port:
.describe("port", "The port").default("port", 8080)
is there a better way for setting up a different port? Possibly from within the package.json with some sort of flag? --port
?
@ehsankorhani that solved my problem. I dont have any other apps running that would be listening to port 8080. but thanks anyways.
Kevin
Holy Frigggin moley, spent 2 hours trying to figure this out guys, wow. ty so much ehsankorhani. :D
Here is the fix: sudo brew uninstall node brew update brew upgrade brew cleanup brew install node sudo chown -R $(whoami) /usr/local brew link --overwrite node brew postinstall node
@ehsankorhani This has solved my problem too. As per netstat -ano on command line I saw my port 8080 is free/not busy. How to terminate a process in that port if it's not been visible in netstat -ano
@owldesign Create a new file ' .env ' in your project root folder... In that file write PORT = 1000 or whatever you want...
i got the same error too. Just do "npm install" within the ReduxSimpleStarter folder cloned Then run npm start
This fix work for me , from cmd run netstat -ano | findstr :yourPortNumber
tthen : taskkill /PID typeyourPIDhere /F
The link explained it very well (https://stackoverflow.com/questions/39632667/how-to-kill-a-currently-using-port-on-localhost-in-windows)
This is an old thread but I'd like to share the Linux solution.
- sudo lsof -i :8080
- sudo kill -9 [the PID Number]
- sudo lsof -i :8080 (one more time to make sure the PID was killed)
- npm start
This might work on MacOS too.
-Enos
one of the reasons you are getting this error is because the port you are trying to access is busy (its been used by some other application)