YMFE / yapi

YApi 是一个可本地部署的、打通前后端及QA的、可视化的接口管理平台
http://yapi.smart-xwork.cn/
Apache License 2.0
27.38k stars 4.79k forks source link

安装问题请看这里 #729

Open hellosean1025 opened 5 years ago

hellosean1025 commented 5 years ago
  1. 确保 node 版本=> 7.6,请运行 node -v 查看版本号
  2. 确保 mongodb 版本 => 2.6,请运行 mongo --version 查看版本号
  3. 确保安装了 npm, 运行 npm -v 查看版本号
  4. 确保安装了 git,运行 git --version 查看版本号
  5. 确保安装了 node-gyp 环境,配置方法

确认版本号没问题,请删除原有的安装文件和数据库,重新安装。

如果安装了 yapi-cli 工具,执行 yapi server 找不到命令,可尝试执行 yapi-cli server

如果是使用了yapi server 可视化部署出的问题,可查看下文档-> 内网部署方式,熟悉 docker 童鞋可以使用 docker 部署,docker 部署的教程可以在 https://github.com/YMFE/yapi 这里找到。

如果还是无法安装,请不要选择最新的版本,可选择上一个版本或上上一个版本等,最新版本出问题的概率会比较大。

有问题请在下面留言,感谢大家的反馈。

newCheng commented 5 years ago

以root身份执行yapi server,可视化页面设置安装报错: 日志如下:

当前安装版本: 1.4.4 连接数据库成功! 开始下载平台文件压缩包... http://registry.npm.taobao.org/yapi-vendor/download/yapi-vendor-1.4.4.tgz 部署文件完成,正在安装依赖库... npm WARN deprecated nomnom@1.5.2: Package no longer supported. Contact support@npmjs.com for more info.

jsonpath@1.0.0 postinstall /data/my-yapi/vendors/node_modules/jsonpath > node lib/aesprim.js > generated/aesprim-browser.js sh: generated/aesprim-browser.js: Permission denied npm WARN eslint-config-modular@4.2.2 requires a peer of eslint@>=3.0.0 but none is installed. You must install peer dependencies yourself. npm WARN mongoose-auto-increment@5.0.1 requires a peer of mongoose@^4.1.12 but none is installed. You must install peer dependencies yourself. npm WARN yapi-vendor@1.4.4 license should be a valid SPDX license expression npm WARN The package moment is included as both a dev and production dependency. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! jsonpath@1.0.0 postinstall: node lib/aesprim.js > generated/aesprim-browser.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the jsonpath@1.0.0 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2019-02-11T09_05_54_645Z-debug.log 依赖库安装完成,正在初始化数据库mongodb... yapi-vendor@1.4.4 install-server /data/my-yapi/vendors > node server/install.js Error: module.js:540 throw err; ^ Error: Cannot find module 'json-schema-faker' at Function.Module._resolveFilename (module.js:538:15) at Function.Module._load (module.js:468:25) at Module.require (module.js:587:17) at require (internal/module.js:11:18) at Object. (/data/my-yapi/vendors/server/utils/commons.js:19:13) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Module.require (module.js:587:17) at require (internal/module.js:11:18) at Object. (/data/my-yapi/vendors/server/install.js:3:17) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32)

newCheng commented 5 years ago

以root身份执行yapi server,可视化页面设置安装报错: 日志如下:

当前安装版本: 1.4.4 连接数据库成功! 开始下载平台文件压缩包... http://registry.npm.taobao.org/yapi-vendor/download/yapi-vendor-1.4.4.tgz 部署文件完成,正在安装依赖库... npm WARN deprecated nomnom@1.5.2: Package no longer supported. Contact support@npmjs.com for more info.

jsonpath@1.0.0 postinstall /data/my-yapi/vendors/node_modules/jsonpath > node lib/aesprim.js > generated/aesprim-browser.js sh: generated/aesprim-browser.js: Permission denied npm WARN eslint-config-modular@4.2.2 requires a peer of eslint@>=3.0.0 but none is installed. You must install peer dependencies yourself. npm WARN mongoose-auto-increment@5.0.1 requires a peer of mongoose@^4.1.12 but none is installed. You must install peer dependencies yourself. npm WARN yapi-vendor@1.4.4 license should be a valid SPDX license expression npm WARN The package moment is included as both a dev and production dependency. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! jsonpath@1.0.0 postinstall: node lib/aesprim.js > generated/aesprim-browser.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the jsonpath@1.0.0 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2019-02-11T09_05_54_645Z-debug.log 依赖库安装完成,正在初始化数据库mongodb... yapi-vendor@1.4.4 install-server /data/my-yapi/vendors > node server/install.js Error: module.js:540 throw err; ^ Error: Cannot find module 'json-schema-faker' at Function.Module._resolveFilename (module.js:538:15) at Function.Module._load (module.js:468:25) at Module.require (module.js:587:17) at require (internal/module.js:11:18) at Object. (/data/my-yapi/vendors/server/utils/commons.js:19:13) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Module.require (module.js:587:17) at require (internal/module.js:11:18) at Object. (/data/my-yapi/vendors/server/install.js:3:17) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32)

问题解决,错误原因在于nodejs的用户权限和用户组与yapi不一致,chown到root就可以了

huaisha1224 commented 5 years ago

请问安装完成后、登录后台一直在加载中 要怎么处理一下呀