nodercms
nodercms copied to clipboard
安装请求失败,请尝试重启服务器与数据库并重新安装
安装请求失败,请尝试重启服务器与数据库并重新安装
不知道怎么回事,mongoDB已经连接成功了,但是安装不了
- 清空数据库
- 确保mongoDB开启了鉴权模式,同时 a超级用户已建立 b数据库用户已建立并拥有readWrite权限 (详见官网帮助中心)
- 重新执行安装流程
2020年10月31日 下午5:07,嘉爷 [email protected] 写道:
安装请求失败,请尝试重启服务器与数据库并重新安装 https://user-images.githubusercontent.com/48110405/97775417-65660e00-1b9b-11eb-836c-6d9241806c6d.png 不知道怎么回事,mongoDB已经连接成功了,但是安装不了
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/welkinwong/nodercms/issues/39, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSXUSEYTFLPS5FAUNWOSRDSNPHTJANCNFSM4TFY2C3Q.
找到问题原因 core\services install.service 147 行 fs.writeFile('install.lock', "true", function (err) {
这里的true 字符串 类型 修改 即可
上面的问题已经解决了,还是遇到同样的情况,报错如下:
[2020-12-23 13:06:51.882] [ERROR] console - (node:21379) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See http://mongoosejs.com/docs/connections.html#use-mongo-client
[2020-12-23 13:06:51.890] [WARN] console - Db.prototype.authenticate method will no longer be available in the next major release 3.x as MongoDB 3.6 will only allow auth against users in the admin db and will no longer allow multiple credentials on a socket. Please authenticate using MongoClient.connect with auth credentials.
根据报错找到文档,,大概意思是说版本更新了,需要在连接的时候设置useMongoClient
这个参数的值为true
所以在代码lib/database.lib.js
中修改一下
function (config, callback) {
mongoose.connect('mongodb://' + config.host + ':' + config.port + '/' + config.db, {
user: config.user,
pass: config.pass
+ useMongoClient:true
}, function (err) {
if (err) {
err.type = 'database';
添加这个参数后,问题解决
useMongoClient:true 增加了这个属性依旧不行
有人解决了这个问题吗?我也是不行
?
确保你的数据库信息是正确的
useMongoClient:true 增加了这个属性依旧不行
解决了吗?
这是来自QQ邮箱的自动回复邮件。