Yapi 安装报错 yapi pass option { useUnifiedTopology: true } to the MongoClient constructor.

20-02-17 21:47 字数 560 阅读 3044

安装yapi时报错如下

DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.

解决方法

修改 vendors/server/utils/db.js 文件,在22行,增加 useUnifiedTopology: true。 然后按照官方的安装方式二继续安装

npm install --production --registry https://registry.npm.taobao.org
npm run install-server //安装程序会初始化数据库索引和管理员账号,管理员账号名可在 config.json 配置
node server/app.js //启动服务器后,请访问 127.0.0.1:{config.json配置的端口},初次运行会有个编译的过程,请耐心等候

如果报错 mongodb 重复插入,就删除 mongodb 的 yapi 库的 user 表的数据,重新安装一次即可。

0人点赞>
关注 收藏 改进 举报
0 条评论
排序方式 时间 投票
快来抢占一楼吧
请登录后发表评论
站长 @ 十七度
文章
380
粉丝
23
喜欢
191
收藏
31
排名 : 1
访问 : 128.36万
私信