Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Node.js port permission denied in Windows 10

When I try to start a server in Express.js I getting this error:

[nodemon] 2.0.12
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node main listen.js`
events.js:352
      throw er; // Unhandled 'error' event
      ^

Error: listen EACCES: permission denied 0.0.0.0:8090
    at Server.setupListenHandle [as _listen2] (net.js:1303:21)
    at listenInCluster (net.js:1368:12)
    at Server.listen (net.js:1454:7)
    at Function.listen (C:\Users\selcuk\Desktop\work\project\node_modules\express\lib\application.js:618:24)
    at Object.<anonymous> (C:\Users\selcuk\Desktop\work\project\listen.js:4:5)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
Emitted 'error' event on Server instance at:
    at emitErrorNT (net.js:1347:8)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  code: 'EACCES',
  errno: -4092,
  syscall: 'listen',
  address: '0.0.0.0',
  port: 8090
}
[nodemon] app crashed - waiting for file changes before starting...

I try to change the port but it didn’t work.
I am using "express": "^4.17.1" and "nodemon": "^2.0.12" as a version.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I have an answer that I think will help. it fixed the issue for me. there is cases where nothing is running on the port but some applications or even your code can not run the fix to this is in this order:

Open PowerShell as Admin.

stop winnat with command below:

net stop winnat

start winnat again with command below:

net start winnat

this fixed the problem for me in many cases. no restart needed. I hope it will help you too.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading