1

I'm trying to run a server with Express.js and each time I try to run it on port 1000 I get the following message:

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

Error: listen EACCES: permission denied 0.0.0.0:1000
at Server.setupListenHandle [as _listen2] (net.js:1301:21)
at listenInCluster (net.js:1366:12)
at Server.listen (net.js:1452:7)
    at Function.listen (/Users/orensayag/Documents/johnBryce/26 - 210421/hw/node_modules/express/lib/application.js:618:24)
at Object.<anonymous> (/Users/orensayag/Documents/johnBryce/26 - 210421/hw/index.js:6:5)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)

Emitted 'error' event on Server instance at: at emitErrorNT (net.js:1345:8) at processTicksAndRejections (internal/process/task_queues.js:80:21) { code: 'EACCES', errno: -13,

  syscall: 'listen',

address: '0.0.0.0', port: 1000 }

I've also heard that Macs have a problem with running on this port, and that in Windows it runs as expected.

Why can't my Mac run a server on port 1000?

Oren Sayag
  • 31
  • 1
  • 4
  • 2
    Does this answer your question? [Binding on privileged ports (ports < 1024) on Mac OS X 10.6](https://stackoverflow.com/questions/7612053/binding-on-privileged-ports-ports-1024-on-mac-os-x-10-6) – Brad Apr 24 '21 at 08:03

1 Answers1

5

For ports lower than 1024 you need to be root. You are getting access denied because the user starting the process does not have a root access.

Bill McKessy
  • 51
  • 1
  • 1