mongoose connection failed with localhost while offline
This is a duplicate of Mongoose Can't Connect Without Internet
Anyhow, just replace localhost
with 127.0.0.1
in the connection string. The issue lies within Windows, see nodejs cannot resolve 'localhost' on windows