Mongoose or MongoDB package not working on Node Server

I created a website using the normal CyberPanel options and edited the context menue in OLS [image]7080) to run node. The website runs fine but the moment I try to connect it with my MongoDB instance either using Mongoose or the native MongoDB Driver, the website stalls.

However, when I remove the code that requires MongoDB, and restart the server, the website works. Any solutions

Welcome to the MongoDB Community Forums @Yogesh_Choudhury !

Please share more details:

  • specific error message output by the driver
  • your versions of MongoDB Node.js driver and Mongoose
  • the version of MongoDB server you have installed (or are trying to connect to)
  • are you connecting to a local MongoDB server or a remotely hosted deployment (for example, MongoDB Atlas)

Before trying to connect to your MongoDB server with a driver, I suggest testing that you are able to connect using the MongoDB shell.