安装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 表的数据,重新安装一次即可。