Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

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

Open
13751139402 opened this issue Oct 31, 2020 · 8 comments

Comments

@13751139402
Copy link

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

@welkinwong
Copy link
Owner

welkinwong commented Nov 5, 2020 via email

@niaolianyu
Copy link

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

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

@NineSenz
Copy link

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

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

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

@demonxwj
Copy link

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

@html9527
Copy link

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

@falost
Copy link

falost commented May 27, 2021

?

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

@ameng404
Copy link

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

解决了吗?

@wugy0103
Copy link

wugy0103 commented Jun 20, 2022 via email

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

No branches or pull requests

9 participants