如何排查Node.js中KeystoneJS-6生产环境的EPROTONOSUPPORT错误?
KeystoneJS-6生产模式启动报错EPROTONOSUPPORT解析
错误信息
Starting Keystone node:events:505 throw er; // Unhandled 'error' event ^ Error: listen EPROTONOSUPPORT: protocol not supported :::3000 at Server.setupListenHandle [as _listen2] (node:net:1355:21) at listenInCluster (node:net:1420:12) at doListen (node:net:1559:7) at processTicksAndRejections (node:internal/process/task_queues:84:21) Emitted 'error' event on Server instance at: at emitErrorNT (node:net:1399:8) at processTicksAndRejections (node:internal/process/task_queues:83:21) { code: 'EPROTONOSUPPORT', errno: -43, syscall: 'listen', address: '::', port: 3000 }
协议类型说明
错误中address: '::'和:::3000的写法,表明Node.js尝试通过IPv6协议监听3000端口,但当前运行环境不支持IPv6协议,因此触发该错误。
临时解决建议
- 修改Keystone的服务器配置,将监听地址指定为IPv4格式的
0.0.0.0,强制使用IPv4协议启动服务 - 检查运行环境的网络配置,确认是否开启了IPv6支持(比如服务器系统、容器网络的IPv6开关)
内容的提问来源于stack exchange,提问作者LongHike
相关产品推荐
相关产品推荐

