Importante

Você está vendo a versão anterior da nova experiência da Alura que estamos preparando para você. Em breve, ela ganha uma identidade visual novinha totalmente pensada em potencializar seus estudos!

1
resposta

Erro Mongo?

Estou com erro ao tentar rodar o Docker do projeto:

(node:1) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
2026-09-03T17:37:04.384935206Z (Use `node --trace-deprecation ...` to show where the warning was created)
2026-09-03T17:37:04.385111503Z (node:1) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
2026-09-03T17:37:04.385388104Z Servidor rodando na porta 8080
2026-09-03T17:37:04.391178157Z Failed to connect to mongo on startup - retrying in 5 sec MongoNetworkError: failed to connect to server [localhost:27017] on first connect [Error: connect ECONNREFUSED 127.0.0.1:27017
2026-09-03T17:37:04.391214242Z     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
2026-09-03T17:37:04.391218479Z   name: 'MongoNetworkError'
2026-09-03T17:37:04.391221639Z }]
2026-09-03T17:37:04.391224465Z     at Pool.<anonymous> (/app/node_modules/mongodb/lib/core/topologies/server.js:438:11)
2026-09-03T17:37:04.391228263Z     at Pool.emit (events.js:315:20)
2026-09-03T17:37:04.391231368Z     at /app/node_modules/mongodb/lib/core/connection/pool.js:562:14
2026-09-03T17:37:04.391234602Z     at /app/node_modules/mongodb/lib/core/connection/pool.js:995:11
2026-09-03T17:37:04.391237365Z     at /app/node_modules/mongodb/lib/core/connection/connect.js:32:7
2026-09-03T17:37:04.391240155Z     at callback (/app/node_modules/mongodb/lib/core/connection/connect.js:280:5)
2026-09-03T17:37:04.391251634Z     at Socket.<anonymous> (/app/node_modules/mongodb/lib/core/connection/connect.js:310:7)
2026-09-03T17:37:04.391255072Z     at Object.onceWrapper (events.js:422:26)
2026-09-03T17:37:04.391258205Z     at Socket.emit (events.js:315:20)
2026-09-03T17:37:04.391261305Z     at emitErrorNT (internal/streams/destroy.js:106:8)
2026-09-03T17:37:04.391264260Z     at emitErrorCloseNT (internal/streams/destroy.js:74:3)
2026-09-03T17:37:04.391267377Z     at processTicksAndRejections (internal/process/task_queues.js:80:21)
2026-09-03T17:37:09.397621936Z 

Não sei daonde esse erro Mongo, pelo que vi, nem tem mongo no projeto....

1 resposta

Oi, Cleyton! Tudo bem?

Curioso que o projeto não use MongoDB, mas apareça um erro de conexão dele. Então, para entender melhor a situação, peço que compartilhe para mim a exata aula em que você estava quando rodou o Docker e aconteceu esse erro e o comando que você utilizou.

Fico no aguardo!