xxxxxxxxxx
npm config set proxy null
npm config set https-proxy null
npm config set registry http://registry.npmjs.org/
xxxxxxxxxx
// instead of this
const url = "mongodb://localhost:27017";
// Just Replace
const url = "mongodb://0.0.0.0:27017";
xxxxxxxxxx
If you're using windows;
-Go to windows searchbar
-search for services and open it
-In services, search for MongoDB server
-right click on it and click on start
worked for me