Node.js Error: connect ECONNREFUSED

后端 未结 12 1150
小鲜肉
小鲜肉 2020-12-02 16:39

I am new to node and running into this error on a simple tutorial.

I am on the OS X 10.8.2 trying this from CodeRunner and the Terminal. I have also tried putting my

12条回答
  •  南方客
    南方客 (楼主)
    2020-12-02 16:58

    Sometimes it may occur, if there is any database connection in your code but you did not start the database server yet.

    Im my case i have some piece of code to connect with mongodb

    mongoose.connect("mongodb://localhost:27017/demoDb");

    after i started the mongodb server with the command mongod this error is gone

提交回复
热议问题