zoukankan      html  css  js  c++  java
  • centos7安装yapi(转)

    如题在linux下安装yapi。官方安装文档安装之前确保已经安装了npm mongodb和git。

    npm install -g yapi-cli --registry https://registry.npm.taobao.org
    yapi server
     

    执行后效果如下

    填写基础的信息

    静静等待安装成功

    按照提示执行命令

    安装成功

    有可能会遇到以下错误

    yapi server
    在浏览器打开 http://0.0.0.0:9090 访问。非本地服务器,请将 0.0.0.0 替换成指定的域名或ip
    events.js:173
    throw er; // Unhandled 'error' event
    ^

    Error: listen EADDRINUSE: address already in use :::9090
    at Server.setupListenHandle [as _listen2] (net.js:1256:14)
    at listenInCluster (net.js:1304:12)
    at Server.listen (net.js:1392:7)
    at Function.serverListen [as listen] (/usr/local/lib/node_modules/yapi-cli/node_modules/express-ws/lib/index.js:42:40)
    at Object.run [as handler] (/usr/local/lib/node_modules/yapi-cli/src/commands/server.js:92:9)
    at Object.runCommand (/usr/local/lib/node_modules/yapi-cli/node_modules/yargs/lib/command.js:226:22)
    at Object.parseArgs [as _parseArgs] (/usr/local/lib/node_modules/yapi-cli/node_modules/yargs/yargs.js:970:30)
    at Function.get [as argv] (/usr/local/lib/node_modules/yapi-cli/node_modules/yargs/yargs.js:912:21)
    at Object.<anonymous> (/usr/local/lib/node_modules/yapi-cli/src/index.js:19:9)
    at Module._compile (internal/modules/cjs/loader.js:736:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:747:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:568:12)
    at Function.Module._load (internal/modules/cjs/loader.js:560:3)
    at Module.require (internal/modules/cjs/loader.js:665:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    Emitted 'error' event at:
    at Server.WebSocketServer._ultron.on (/usr/local/lib/node_modules/yapi-cli/node_modules/ws/lib/WebSocketServer.js:85:46)
    at Server.emit (events.js:197:13)
    at emitErrorNT (net.js:1283:8)
    at processTicksAndRejections (internal/process/next_tick.js:76:17)
    at process.runNextTicks [as _tickCallback] (internal/process/next_tick.js:51:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:804:11)
    at executeUserCode (internal/bootstrap/node.js:526:15)
    at startMainThreadExecution (internal/bootstrap/node.js:439:3)
    这是之前的运行过yapi但是没有杀死进程而已。ps aux | grep yapi找到进程杀死即可。
    ————————————————
    版权声明:本文为CSDN博主「the ache」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/weixin_44600422/article/details/89345944

  • 相关阅读:
    linux常用脚本
    shell学习笔记
    Linux常用命令List
    Centos7部署Zabbix
    centos7安装nagios步骤
    nagios报错HTTP WARNING: HTTP/1.1 403 Forbidden解决方法
    U盘安装CentOS7
    Thread线程控制之sleep、join、setDaemon方法的用处
    EfficientDet框架详解 | 目前最高最快最小模型,可扩缩且高效的目标检测(附源码下载)
    ubuntu18.04 安装多版本cuda ,原来版本为9.0,在新增8.0
  • 原文地址:https://www.cnblogs.com/lza945/p/12511663.html
Copyright © 2011-2022 走看看