Answer the question
In order to leave comments, you need to log in
Why does node-static give permission denied: port?
Hello!
Decided to get into webpack. A simple static server wanted to run, the node-static module.
Since there were no modules, I registered these:
npm i -g webpack
npm i -g node-static
static
in cygwin, the output is:[email protected] /cygdrive/a/webpack
$ static
serving "." at http://127.0.0.1:8080
events.js:174
throw er; // Unhandled 'error' event
^
Error: listen EACCES: permission denied 127.0.0.1:8080
at Server.setupListenHandle [as _listen2] (net.js:1262:19)
at listenInCluster (net.js:1327:12)
at doListen (net.js:1460:7)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Emitted 'error' event at:
at emitErrorNT (net.js:1306:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
[... lines matching original stack trace ...]
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Error: listen EACCES: permission denied 127.0.0.1:8080
webpack.config.js
//webpack.config.js
module.exports = {
entry: './home',
output: {
// path: __dirname + '/dist',
filename: 'build.js'
},
devServer: {
historyApiFallback: true,
port: 8080 //<-- вот эта строка и добавил свой порт
}
}
static
but still denied permissionAnswer the question
In order to leave comments, you need to log in
I’ll write my answer, although the question is very old, and the author has probably studied Webpack up and down for a long time. And he does not need this answer. But maybe someone will come in handy.
And I have the same problem now with this static. I'm apparently now going through the same Webpack screencast that the author of this question was going through when he asked this question.
So, my problem is solved by changing the port for a static server. From 8080 to some other. And I did it in the console like this:
static --port 3001
And it all worked.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question