The mongodb service has started, but the Connection.DEFAULT_PORT cannot be read.

  mongodb, question

The mongodb service has been started and the browser can access localhost:27017, but the console still reported an error and cannot read Connection.DEFAULT_PORT; Novice Begs Great Spirit to Solve

clipboard.png

clipboard.png

clipboard.png
I also found a lot of articles by Baidu, but I didn’t solve them. I don’t know what the problem is, saying that the definition of using the default port is like this. Beginners ask for help!

This actually has nothing to do with MongoDB server itself, it is a problem of driver usage.
You need to determine what version of driver you are using, whether it is native-driver or mongoose.
The code is probably what you see from somewhere else, and the main problem may still be that the driver version you use is different from others.