• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

몽고DB 연결이 안됩니다ㅠㅠㅠㅠ

21.04.29 02:00 작성 조회수 147

2

> boiler-plate@1.0.0 start C:\Users\rwlee\Documents\boiler-plate

> node index.js

Example app listening at http://localhost:5000

(node:27640) UnhandledPromiseRejectionWarning: MongoError: bad auth : Authentication failed.

    at MessageStream.messageHandler (C:\Users\rwlee\Documents\boiler-plate\node_modules\mongodb\lib\cmap\connection.js:268:20)    at MessageStream.emit (events.js:315:20)

    at processIncomingData (C:\Users\rwlee\Documents\boiler-plate\node_modules\mongodb\lib\cmap\message_stream.js:144:12)     

    at MessageStream._write (C:\Users\rwlee\Documents\boiler-plate\node_modules\mongodb\lib\cmap\message_stream.js:42:5)      

    at writeOrBuffer (internal/streams/writable.js:358:12)

    at MessageStream.Writable.write (internal/streams/writable.js:303:10)

    at TLSSocket.ondata (internal/streams/readable.js:719:22)

    at TLSSocket.emit (events.js:315:20)

    at addChunk (internal/streams/readable.js:309:12)

    at readableAddChunk (internal/streams/readable.js:284:9)

    at TLSSocket.Readable.push (internal/streams/readable.js:223:10)

    at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)

(Use `node --trace-warnings ...` to show where the warning was created)

(node:27640) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

(node:27640) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

이런 에러가 뜨는데 어떻게 해야 할까요?ㅠㅠ

답변 1

답변을 작성해보세요.

2

JYEJYE님의 프로필

JYEJYE

2021.05.10

시간이 좀 지났지만 저도 비슷한 에러 나서 검색해봤는데, 본인 ip주소를 몽고db에 추가연결해서 해결했어요. mongdb 사이트에서 왼쪽메뉴에 Network Access 메뉴 들어가셔서 ip주소 추가하시고 다시 터미널로 실행해보세요.

지현님의 프로필

지현

2021.08.16

감사합니다 ! 덕분에 해결했습니다 ㅎㅎ