Git Product home page Git Product logo

Comments (8)

NineSenz avatar NineSenz commented on September 25, 2024 1

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

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

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

from nodercms.

welkinwong avatar welkinwong commented on September 25, 2024

from nodercms.

niaolianyu avatar niaolianyu commented on September 25, 2024

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

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

from nodercms.

demonxwj avatar demonxwj commented on September 25, 2024

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

from nodercms.

html9527 avatar html9527 commented on September 25, 2024

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

from nodercms.

falost avatar falost commented on September 25, 2024

?

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

from nodercms.

ameng404 avatar ameng404 commented on September 25, 2024

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

解决了吗?

from nodercms.

wugy0103 avatar wugy0103 commented on September 25, 2024

from nodercms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.