解决Yapi报错Cannot find module 'yapi-plugin-export-docx-data'

起Yapi服务时候,报如下错误:

Error: Cannot find module 'yapi-plugin-export-docx-data'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at getPluginConfig (/opt/yapi/vendors/common/plugin.js:8:20)
    at plugins.map.item (/opt/yapi/vendors/common/plugin.js:39:22)
    at Array.map (<anonymous>)
    at exports.initPlugins (/opt/yapi/vendors/common/plugin.js:33:21)
    at Object.<anonymous> (/opt/yapi/vendors/server/plugin.js:235:21)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)

解决办法:

在yapi的安装目录找到config.json文件,打开此文件:

{
   "port": "3011",
   "adminAccount": "ycyzharry@testgu.com",
   "db": {
      "servername": "127.0.0.1",
      "DATABASE": "yapi",
      "port": "27017"
   },
   "mail": {
      "enable": true,
      "host": "outlook.testgu.com",
      "port": 25,
      "from": "ycyzharry@testgu.com",
      "auth": {
         "user": "ycyzharry@testgu.com",
         "pass": "*****"
      },
      "tls": {
         "rejectUnauthorized": false
      }
   },
   "plugins": [
      {
         "name": "export-docx-data"
      }
   ]
}

去掉红色那部分代码,再重启Yapi服务。

 

posted @ 2021-03-12 22:55  ycyzharry  阅读(1769)  评论(0)    收藏  举报