인프런 커뮤니티 질문&답변

램반장님의 프로필 이미지
램반장

작성한 질문수

따라하며 배우는 노드, 리액트 시리즈 - 기본 강의

노드 리액트 기초 강의 #3 몽고 DB 연결

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

작성

·

212

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

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

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

램반장님의 프로필 이미지
램반장

작성한 질문수

질문하기