Comments (8)
上面的问题已经解决了,还是遇到同样的情况,报错如下:
[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.
from nodercms.
找到问题原因 core\services install.service 147 行 fs.writeFile('install.lock', "true", function (err) {
这里的true 字符串 类型 修改 即可
from nodercms.
useMongoClient:true 增加了这个属性依旧不行
from nodercms.
有人解决了这个问题吗?我也是不行
from nodercms.
?
确保你的数据库信息是正确的
from nodercms.
useMongoClient:true 增加了这个属性依旧不行
解决了吗?
from nodercms.
from nodercms.
Related Issues (20)
- column-*.hbs中{{current}}为空 HOT 4
- mongodb auth HOT 1
- 希望能支持 node 8+ HOT 2
- 请教一个问题 HOT 1
- MongoDB cluster HOT 1
- 怎么支持阿里云MongoDB HOT 1
- 512M的VPS能跑吗? HOT 1
- 部署到阿里云上用IP不能访问
- 手机上访问演示站的后台时候,页面显示错乱 HOT 1
- 优化建议 HOT 1
- nodercms如何嵌入到nuxt.js工程? HOT 1
- 初始化连接不到数据库,报错 HOT 1
- 你们的官网不能访问了 HOT 2
- 如何生成html HOT 3
- 关于连接MongoDB Atlas的云集群
- 如何实现一个简单的留言板功能? 只能自己二开代码实现? HOT 2
- 如何实现网站的多语言呢? HOT 4
- very good! HOT 1
- 数据库连接失败,请检查是否填写正确或联系数据库管理员 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodercms.