Fix Mongoose Server Selection Error in Express | Node.js Database Connection Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ธ.ค. 2024

ความคิดเห็น • 7

  • @harsh-raj-6982
    @harsh-raj-6982 5 ชั่วโมงที่ผ่านมา

    After following your solution, I was still not happy with the solution. However, when I tried the suggestions provided in the comments, the issue was resolved.
    1) Removed the older Node.js version (v18) and installed the latest one (v22).
    2) Restart VS code terminal by closing the VS code editor.
    3) Deleted the package-lock.json file and the node_modules folder, then ran the "npm install" command again.
    Now it's working. Thanks once again!

    • @osegocodes
      @osegocodes  5 ชั่วโมงที่ผ่านมา +1

      @@harsh-raj-6982 will definitely try this out and see if it works, is it a permanent solution? Thanks buddy

    • @harsh-raj-6982
      @harsh-raj-6982 2 ชั่วโมงที่ผ่านมา +1

      @ Yaa, its a permanent solution. Tried the same in multiple Mac and windows PC and it works.

    • @osegocodes
      @osegocodes  2 ชั่วโมงที่ผ่านมา

      @@harsh-raj-6982 awesome, I will do another video for the permanent solution ✅✅. Thanks for the contribution

  • @harsh-raj-6982
    @harsh-raj-6982 18 ชั่วโมงที่ผ่านมา +1

    But this is a temporary solution…

    • @osegocodes
      @osegocodes  17 ชั่วโมงที่ผ่านมา

      Yeap, it's still an issue on the mongoose repo. If you use a paid atlas tier then you won't face the error

    • @harsh-raj-6982
      @harsh-raj-6982 5 ชั่วโมงที่ผ่านมา

      After following your solution, I was still not happy with the solution. However, when I tried the suggestions provided in the comments, the issue was resolved.
      1) Removed the older Node.js version (v18) and installed the latest one (v22).
      2) Restart VS code terminal by closing the VS code editor.
      3) Deleted the package-lock.json file and the node_modules folder, then ran the "npm install" command again.
      Now it's working. Thanks once again!