yum install mongodb
yum install -y nodejs
git clone https://gitee.com/mirrors/YApi.git
- 克隆项目到本地
- 使用命令进入项目所在目录
- 首次使用先运行npm install -g yapi-cli --registry https://registry.npm.taobao.org
- 运行yapi server
如果提示找不到yapi命令,按下面的处理
[root@jhkj66 home]# npm install -g yapi-cli --registry https://registry.npm.taobao.org
/server/tools/node-v8.11.4-linux-x64/bin/yapi -> /server/tools/node-v8.11.4-linux-x64/lib/node_modules/yapi-cli/bin/yapi-cli
/server/tools/node-v8.11.4-linux-x64/bin/yapi-cli -> /server/tools/node-v8.11.4-linux-x64/lib/node_modules/yapi-cli/bin/yapi-cli
+ yapi-cli@1.2.8
added 266 packages in 7.322s
[root@jhkj66 home]# yapi server
-bash: yapi: 未找到命令
找不到命令这个报错要看上一条命令中yapi的位置,他都会告诉你的进去以后执行命令:
[root@jhkj66 bin]# ./yapi server
在浏览器打开http://0.0.0.0:9090 访问。非本地服务器,请将0.0.0.0 替换成指定的域名或ip