ReduxSimpleStarter icon indicating copy to clipboard operation
ReduxSimpleStarter copied to clipboard

npm start throw an error, can't run the course

Open eran-or opened this issue 7 years ago • 3 comments

PS D:\Code\react\web\ReduxSimpleStarter> npm start

[email protected] start D:\Code\react\web\ReduxSimpleStarter node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js

events.js:160 throw er; // Unhandled 'error' event ^

Error: listen EACCES 127.0.0.1:8080

eran-or avatar Oct 19 '17 08:10 eran-or

@eran-or More than likely that port is already in use on your machine, or the server is already running. You can either end the process that is running on the port, or you can change the port that webpack dev server is running on.

If you open the webpack.config.js file, and update this code:

devServer: {
    historyApiFallback: true,
    contentBase: './'
  }

to:

devServer: {
    historyApiFallback: true,
    contentBase: './',
    port: 3000
  }

The server should start on port 3000. You can choose another port if you want.

scottwestover avatar Oct 24 '17 19:10 scottwestover

@scottwestover It worked, thank you.

shriomtri avatar Aug 03 '18 04:08 shriomtri

This fix really should be pulled into the master branch. Thanks @scottwestover !

papanugget avatar Sep 19 '18 20:09 papanugget