参考:https://www.mongodb.com/community/forums/t/mongodb-doesnt-work-with-node-js-18-12-1/199571/3
::1是ipv6的localhost地址,不等同于ipv4的localhost(127.0.0.1)。mongoDB在127.0.0.0:27017上侦听,所以连接::1:27017会失败。
把DB_HOST中的localhost改成127.0.0.1就可以成功连接了。
标签:ECONNREFUSED,127.0,0.1,27017,MongooseServerSelectionError,connect,localhost From: https://www.cnblogs.com/cgoo/p/16908510.html