MongoNetworkError: failed to connect to server [localhost:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017]

前端 未结 26 2839
轻奢々
轻奢々 2020-11-30 04:34

I\'m new in nodeJS, started learning by following a trailer on youtube, everything goes well until I added the connect function if mongodb,

mongo.connect(\"m         


        
26条回答
  •  一生所求
    2020-11-30 05:05

    If Install before Mongodb Just Start with this code :

    brew services start mongodb-community
    next => mongod
    

    If Not Install before this Way

    1.brew tap mongodb/brew
    2.brew install mongodb-community
    3.brew services start mongodb-community
    4.mongod
    

提交回复
热议问题