node 11.11
npm 6.9.0
windows 10
I get the error no matter which build system I use, gulp or laravel-mix.
events.js:173
throw er; // Unhandled 'error' event
^
Error: listen EACCES: permission denied 0.0.0.0:3000
at Server.setupListenHandle [as _listen2] (net.js:1239:19)
at listenInCluster (net.js:1304:12)
at Server.listen (net.js:1392:7)
at module.exports.plugin (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\server\index.js:27:25)
at Object.startServer [as fn] (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\async.js:177:52)
at C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\browser-sync.js:120:14
at iterate (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\utils.js:269:9)
at C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\utils.js:281:21
at executeTask (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\browser-sync.js:136:13)
at Object.mergeMiddlewares [as fn] (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\async.js:166:9)
at C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\browser-sync.js:120:14
at iterate (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\utils.js:269:9)
at C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\utils.js:281:21
at executeTask (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\browser-sync.js:136:13)
at Object.setFileWatchers [as fn] (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\async.js:155:9)
at C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\browser-sync.js:120:14
at iterate (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\utils.js:269:9)
at C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\utils.js:281:21
at executeTask (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\browser-sync.js:136:13)
at Object.setInternalEvents [as fn] (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\async.js:148:9)
at C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\browser-sync.js:120:14
at iterate (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\utils.js:269:9)
at C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\utils.js:281:21
at executeTask (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\browser-sync.js:136:13)
at Object.setOptions [as fn] (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\async.js:133:9)
at C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\browser-sync.js:120:14
at iterate (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\utils.js:269:9)
at C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\utils.js:281:21
at executeTask (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\browser-sync.js:136:13)
at Object.resolveInlineUserPlugins [as fn] (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\async.js:125:9)
at C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\browser-sync.js:120:14
at iterate (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\utils.js:269:9)
at C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\utils.js:281:21
at executeTask (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\browser-sync.js:136:13)
at QueryReqWrap.callback (C:\Users\$USER\Sites\my-site\wp-content\themes\my-site\node_modules\browser-sync\dist\async.js:92:17)
at QueryReqWrap.onresolve [as oncomplete] (dns.js:201:10)
Emitted 'error' event at:
at emitErrorNT (net.js:1283:8)
at processTicksAndRejections (internal/process/next_tick.js:76:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\$USER\AppData\Roaming\npm-cache\_logs\2019-03-08T08_41_02_106Z-debug.log
If anyone else is having a similar problem on windows. The issue is the virtual ethernet adapter created by docker. Once I disabled it everything went back to working normally.
For anyone hitting their heads on the wall trying to figure this out, it can be any new or old network connection. In my case, docker was working fine with webpack server and then I installed a bluetooth USB dongle that created a new network that somehow messed with the system ports?/network? So I had to disable that bluetooth network connection and not docker vEthernat NAT adapter.
After trying many different ways, re-installing IIS on my windows solved the problem.
In my case I had a site created and running in IIS with 3000 port. That is why it showed permission denied. Stopping the site made it work.
VirtualBox connections were my problem on Windows 10. I used @bonovski guidance and disabled those connections. After that my error disappeared.
disable vEthernat NAT adapter solved the problem(it is a solution but not the best), my question is why browser-sync still trying to access 0.0.0.0 in order to listen all possible ip after i specify the host. in this case, i expect browser-sync only listen localhost:3001.

Most helpful comment
If anyone else is having a similar problem on windows. The issue is the virtual ethernet adapter created by docker. Once I disabled it everything went back to working normally.