Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Deprecated in mongoose #24

Closed
angelfreedomv opened this issue Sep 21, 2017 · 9 comments
Closed

Deprecated in mongoose #24

angelfreedomv opened this issue Sep 21, 2017 · 9 comments

Comments

@angelfreedomv
Copy link

I found a problem:
[2017-09-21 12:04:47.191] [ERROR] console - (node:8808) 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.

@angelfreedomv
Copy link
Author

是不是mongoose版本不对?我看了您的webpack的mongoose版本是4.6.0的。需要安装旧版本mongodb对吗?

@skyvow
Copy link
Owner

skyvow commented Sep 21, 2017

@angelfreedomv 有可能,最好按照 package.json 版本来。另外我本地 mongodb-3.2.7、redis-3.2.3。

@angelfreedomv
Copy link
Author

你本地测试是windows还是mac os系统?我看了一下本地的mongodb是3.4.9版本,要降级版本对吧。

@skyvow
Copy link
Owner

skyvow commented Sep 21, 2017

@angelfreedomv mac

@angelfreedomv
Copy link
Author

好的 谢谢了 我降级版本试试

@angelfreedomv
Copy link
Author

mongodb 3.2 windows版本在网上不好找了啊

@angelfreedomv
Copy link
Author

[2017-09-21 16:10:42.710] [ERROR] console - (node:11080) 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
[2017-09-21 16:10:42.730] [INFO] console - ------ Express server listening on port 3000 ------
[2017-09-21 16:10:42.754] [INFO] console - ------ Redis connection succeed ------
[2017-09-21 16:10:42.839] [INFO] console - ------ Mongodb connection succeed ------
[2017-09-21 16:10:42.920] [ERROR] console - (node:11080) DeprecationWarning: Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html

我找到了 3.2.7版本,还是不行,老是出这样的问题,是不是要改成openUri() ?。

@angelfreedomv
Copy link
Author

解决了,刚才网络问题少装了依赖

@shuracwf
Copy link

shuracwf commented Sep 25, 2017

我使用了以下步骤解决了此问题:
npm remove mongoose
npm install mongoose@4.10.8 --save

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

3 participants