nodercms icon indicating copy to clipboard operation
nodercms copied to clipboard

安装请求失败,请尝试重启服务器与数据库并重新安装

Open 13751139402 opened this issue 4 years ago • 8 comments

安装请求失败,请尝试重启服务器与数据库并重新安装 微信截图_20201031170559 不知道怎么回事,mongoDB已经连接成功了,但是安装不了

13751139402 avatar Oct 31 '20 09:10 13751139402

  1. 清空数据库
  2. 确保mongoDB开启了鉴权模式,同时 a超级用户已建立 b数据库用户已建立并拥有readWrite权限 (详见官网帮助中心)
  3. 重新执行安装流程

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.

welkinwong avatar Nov 05 '20 07:11 welkinwong

找到问题原因 core\services install.service 147 行 fs.writeFile('install.lock', "true", function (err) {

这里的true 字符串 类型 修改 即可

niaolianyu avatar Nov 26 '20 16:11 niaolianyu

上面的问题已经解决了,还是遇到同样的情况,报错如下:

[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';

添加这个参数后,问题解决

NineSenz avatar Dec 23 '20 05:12 NineSenz

useMongoClient:true 增加了这个属性依旧不行

demonxwj avatar Apr 20 '21 02:04 demonxwj

有人解决了这个问题吗?我也是不行

html9527 avatar May 27 '21 10:05 html9527

?

确保你的数据库信息是正确的

falost avatar May 27 '21 10:05 falost

useMongoClient:true 增加了这个属性依旧不行

解决了吗?

ameng404 avatar Jun 20 '22 08:06 ameng404

这是来自QQ邮箱的自动回复邮件。  

wugy0103 avatar Jun 20 '22 08:06 wugy0103