Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

部署报错 #687

Open
yzhahn opened this issue Dec 5, 2018 · 1 comment
Open

部署报错 #687

yzhahn opened this issue Dec 5, 2018 · 1 comment

Comments

@yzhahn
Copy link

yzhahn commented Dec 5, 2018

ubuntu16.04
YApi v1.4.1

部署时报错:
当前安装版本: v1.4.1
连接数据库成功!
开始下载平台文件压缩包...
http://yapi.demo.qunar.com/publicapi/archive/v1.4.1
部署文件完成,正在安装依赖库...
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.1 license should be a valid SPDX license expression
npm
WARN
The package moment is included as both a dev and production dependency.
up to date in 15.989s
依赖库安装完成,正在初始化数据库mongodb...

yapi-vendor@1.4.1 node server/install.js
Error: (node:2509) UnhandledPromiseRejectionWarning: ValidationError: user validation failed: username: Path username is required.

@gsoyond
Copy link

gsoyond commented Jan 27, 2019

我部署的是1.4.4的版本,开始也是报同样的错误,mongodb的配置核对了好几遍,最后通过查看server/install.js脚本才发现问题所在。install.js的第27行使用indexOf('@')来用设置的管理员邮箱中取管理员用户名,所以如果像我开始那样adminAccount设置的不是邮箱的话,就会报错。所以解决方法也很简单,将adminAccount改成邮箱就行。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants