解決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服務。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM