open() depreciation. How to fix this?
talmax1124 opened this issue · 2 comments
(node:10530) 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/4.x/docs/connections.html#use-mongo-client
(Use node --trace-deprecation ...
to show where the warning was created)
/Users/carlosdiazplaza/lets-chat/node_modules/mongodb/lib/mongo_client.js:421
throw err
^
Error [MongoError]: failed to connect to server [localhost:27017] on first connect [Error: connect ECONNREFUSED 127.0.0.1:27017
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
name: 'MongoError'
}]
at Pool. (/Users/carlosdiazplaza/lets-chat/node_modules/mongodb-core/lib/topologies/server.js:336:35)
at Pool.emit (events.js:315:20)
at Connection. (/Users/carlosdiazplaza/lets-chat/node_modules/mongodb-core/lib/connection/pool.js:280:12)
at Object.onceWrapper (events.js:422:26)
at Connection.emit (events.js:315:20)
at Socket. (/Users/carlosdiazplaza/lets-chat/node_modules/mongodb-core/lib/connection/connection.js:189:49)
at Object.onceWrapper (events.js:422:26)
at Socket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lets-chat@0.4.8 start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lets-chat@0.4.8 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/carlosdiazplaza/.npm/_logs/2021-02-16T21_27_08_134Z-debug.log
The terminal process "/bin/zsh '-c', 'npm run start'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
you need to install mongoDB on your machine
https://www.mongodb.com/try/download/community?tck=docs_server
you need to install mongoDB on your machine https://www.mongodb.com/try/download/community?tck=docs_server
I installed MongoDB and provide connection but show same error