yapi部署最后一步:点击开始部署后初始化mongodb失败

来源:20-3 yapi的安装和配置

starrysky1986

2021-07-07

点击开始部署后初始化mongodb失败

yapi_1   | 依赖库安装完成,正在初始化数据库mongodb...
yapi_1   |
yapi_1   | > yapi-vendor@1.9.2 install-server /my-yapi/vendors
yapi_1   | >  node server/install.js
yapi_1   | 
yapi_1   | 
yapi_1   | Error:  /my-yapi/vendors/server/utils/commons.js:25
yapi_1   | jsf.extend('mock', function () {
yapi_1   |     ^
yapi_1   | 
yapi_1   | TypeError: jsf.extend is not a function
yapi_1   |     at Object.<anonymous> (/my-yapi/vendors/server/utils/commons.js:25:5)
yapi_1   |     at Module._compile (internal/modules/cjs/loader.js:999:30)
yapi_1   |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
yapi_1   |     at Module.load (internal/modules/cjs/loader.js:863:32)
yapi_1   |     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
yapi_1   |     at Module.require (internal/modules/cjs/loader.js:887:19)
yapi_1   |     at require (internal/modules/cjs/helpers.js:74:18)
yapi_1   |     at Object.<anonymous> (/my-yapi/vendors/server/install.js:3:17)
yapi_1   |     at Module._compile (internal/modules/cjs/loader.js:999:30)
yapi_1   |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
yapi_1   |     at Module.load (internal/modules/cjs/loader.js:863:32)
yapi_1   |     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
yapi_1   |     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
yapi_1   |     at internal/main/run_main_module.js:17:47

nodejs 版本 v16.4.2

写回答

2回答

starrysky1986

提问者

2021-11-04

找到解决方法了

https://www.cnblogs.com/dongv5/p/14990289.html

(1)打开/root/my-yapi/vendors/server/utils/commons.js文件,将所谓的jsf.extend给注释掉。

$ cd /root/my-yapi/vendors/server/utils/    # 进入utils目录
$ vi commons.js                             # 编辑common.js

//img.mukewang.com/szimg/6183a135095b3c6e07540390.jpg

屏蔽掉这段代码就行了

0
1
bobby
好的。。。
2021-11-08
共1条回复

bobby

2021-07-08

你可以留下qq 我加你看看

0
2
bobby
回复
0202yyt
首次启动记得修改docker-compose.yaml文件中的command命令,文件中有注释说明
2021-07-16
共2条回复

Go+Python打造电商系统 自研微服务框架 抓紧高薪机遇

快速转型Go工程师,成为具备双语言后端能力的开发者

508 学习 · 530 问题

查看课程