Open julschong opened 2 years ago
As in the issue https://github.com/ljlm0402/typescript-express-starter/issues/117, another solution is that try to change the DB_HOST
variable to mongo
in the configuration file .env.development.local
I changed port and DB_NAME, it solved my issue.
Hi there,
This is a minor issue that has a solution posted below.
Describe the Bug (버그 설명)
I used the mongoose template and it would start up the server but crashed within 20 secs. And no error message is shown on the terminal. After looking into the log, it shows:
2022-04-12 02:19:48 error: uncaughtException: connect ECONNREFUSED ::1:27017 MongooseServerSelectionError: connect ECONNREFUSED ::1:27017
Version to Reproduce (현재 사용한 버전)
typescript-express-starter@8.1.7
Steps to Reproduce (재현 순서)
Expected Behavior (예상 동작)
Server start without crashing
Actual Behavior (실제 동작)
Server crashes within 20 secs, logs
2022-04-12 02:19:48 error: uncaughtException: connect ECONNREFUSED ::1:27017 MongooseServerSelectionError: connect ECONNREFUSED ::1:27017
Additional Context (추가 사항)
Confirmed that node 17 is the cause of this. Here is the thread I found about this: https://www.mongodb.com/community/forums/t/mongooseserverselectionerror-connect-econnrefused-127-0-0-1-27017/123421
I tested and confirmed:
DB_HOST = localhost
toDB_HOST = 127.0.0.1
in .env.development.local worked for Node 17.8.0Capture screen (캡쳐 화면)