Webpack-dev-server: Throws unhandled error in event.js

Created on 4 Nov 2017  路  5Comments  路  Source: webpack/webpack-dev-server

  • Operating System: Ubuntu 17.10
  • Node Version: 8.9.0
  • NPM Version: 5.5.1
  • webpack Version: 3.8.1
  • webpack-dev-server Version: 2.9.4

  • [x] This is a bug

  • [ ] This is a feature request
  • [ ] This is a modification request

Code

webpack.config.js

Expected Behavior

Dev-Server starts

Actual Behavior

Dev-Server throws an error:

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

Error: listen EACCES 127.0.0.1:80
    at Object._errnoException (util.js:1024:11)
    at _exceptionWithHostPort (util.js:1046:20)
    at Server.setupListenHandle [as _listen2] (net.js:1334:19)
    at listenInCluster (net.js:1392:12)
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1501:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:10)

Command used:

./node_modules/.bin/webpack-dev-server

For Bugs; How can we reproduce the behavior?

Try to use dev-server with this webpack.config.js

Most helpful comment

@Wavum that means the port you specified is in use. Please see the issue template about support questions and use one of the available options in the future.

All 5 comments

@Wavum that means the port you specified is in use. Please see the issue template about support questions and use one of the available options in the future.

it is more than access-grant issue than port-in-use issue. I faced the same problem and still don't don't find a clue how to solve it.

For a quick solution run your webpack-dev-server with sudo I could manage to start dev server with sudo.

May or may not be useful but sometimes when I run into these issues I pass the --no-optional flag magic

I ran into the same error message. It turns out I had previously installed tomcat web server on my machine. Tomcat was already utilizing 127.0.0.1:80 (which means tomcat is running on port 80)

The error message is a little confusing since the first error message is about "events.js:183
throw er". But you can ignore that. The real issue is the port conflict:
Error: listen EACCES 127.0.0.1:80

To resolve the issue, I updated webpack.config.js to use a different port instead of the default port 80. For me, port 9000, worked great. Here's my complete webpack.config.js file, with the port 9000 specified on one of the last lines:

module.exports = {
entry: [
'./src/index.js'
],
output: {
path: __dirname,
publicPath: '/',
filename: 'bundle.js'
},
module: {
loaders: [{
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['react', 'es2015', 'stage-1']
}
}]
},
resolve: {
extensions: ['', '.js', '.jsx']
},
devServer: {
historyApiFallback: true,
contentBase: './',
port: 9000
}
};

@VayaBuzz Thanks for your answer, I had the same issue before, but now I change the port so that the problem had been fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wojtekmaj picture wojtekmaj  路  3Comments

Ky6uk picture Ky6uk  路  3Comments

antoinerousseau picture antoinerousseau  路  3Comments

subblue picture subblue  路  3Comments

mischkl picture mischkl  路  3Comments