ReduxSimpleStarter icon indicating copy to clipboard operation
ReduxSimpleStarter copied to clipboard

can't run the project

Open roytz opened this issue 8 years ago • 13 comments

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

roytz avatar Aug 05 '16 13:08 roytz

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!

mackenix avatar Aug 07 '16 18:08 mackenix

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

qasimalyas avatar Aug 09 '16 14:08 qasimalyas

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)

ehsankorhani avatar Aug 28 '16 12:08 ehsankorhani

is there a better way for setting up a different port? Possibly from within the package.json with some sort of flag? --port?

owldesign avatar Aug 31 '16 17:08 owldesign

@ehsankorhani that solved my problem. I dont have any other apps running that would be listening to port 8080. but thanks anyways.

Kevin

kboger avatar Sep 22 '16 12:09 kboger

Holy Frigggin moley, spent 2 hours trying to figure this out guys, wow. ty so much ehsankorhani. :D

desmondpsingh avatar Aug 08 '17 18:08 desmondpsingh

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

Nitin88gupta avatar Nov 18 '17 10:11 Nitin88gupta

@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

kalyanj92 avatar Dec 31 '17 22:12 kalyanj92

@owldesign Create a new file ' .env ' in your project root folder... In that file write PORT = 1000 or whatever you want...

xaheed avatar Mar 21 '18 08:03 xaheed

i got the same error too. Just do "npm install" within the ReduxSimpleStarter folder cloned Then run npm start

crjoseph97 avatar May 25 '18 12:05 crjoseph97

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)

Kname80 avatar Aug 11 '18 19:08 Kname80

This is an old thread but I'd like to share the Linux solution.

  1. sudo lsof -i :8080
  2. sudo kill -9 [the PID Number]
  3. sudo lsof -i :8080 (one more time to make sure the PID was killed)
  4. npm start

This might work on MacOS too.

-Enos

enosV avatar Sep 27 '18 05:09 enosV

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)

rahulchavan30 avatar Oct 09 '18 17:10 rahulchavan30