在使用global.Promisereplacemongoose的mpromise库时出现TypeScript错误

我使用Mongoose的承诺,通常会抛出Mongoose使用的内部mpromise库的弃用警告。

在大多数 地方给出的解决方法是用本地Promise代替Mongoose的承诺库,像这样

mongoose.Promise = global.Promise 

但是,因为将我的项目转换为TypeScript我的IDE(VS代码)现在抛出一个错误说

 message: 'Type 'Function' is not assignable to type 'typeof Promise'. Property 'fulfilled' is missing in type 'Function'.' 

在这里输入图像描述

我怎么能解决这个问题?