【发布时间】:2021-04-24 07:35:11
【问题描述】:
我正在尝试使用 Express.js 运行服务器,每次尝试在端口 1000 上运行它时都会收到以下消息:
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)
在服务器实例上发出“错误”事件: 在 emitErrorNT (net.js:1345:8) 在 processTicksAndRejections (internal/process/task_queues.js:80:21) { 代码:'EACCES', 错误号:-13,
syscall: 'listen',
地址:'0.0.0.0', 端口:1000 }
我还听说 Mac 在此端口上运行存在问题,而在 Windows 中它可以按预期运行。
为什么我的 Mac 不能在端口 1000 上运行服务器?
【问题讨论】:
标签: macos express port backend