mongoose(6.0.12) 抛出错误 Error: option gssapiservicename is not supported
。
这里是设置mongodb连接的代码:
const connectDB = async () => {
try {
const conn = await mongoose.connect(process.env.MONGO_URI, {
useUnifiedTopology: true,
useNewUrlParser: true,
})
console.log(`MongoDB Connected: ${conn.connection.host}`.cyan.underline)
} catch (error) {
console.error(`Error: ${error.message}`.red.underline.bold)
process.exit(1)
}
最佳答案
只需删除连接字符串中的参数,较新版本的客户端不再支持此功能
关于node.js - 错误 : option gssapiservicename is not supported,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69882113/