connect ECONNREFUSED 127.0.0.1:27017'

前端 未结 8 1157
南旧
南旧 2021-01-13 19:36

I have that code:

var express = require(\'express\'),
    stylus = require(\'stylus\'),
    logger = require(\'morgan\'),
    bodyParser = require(\'body-par         


        
8条回答
  •  半阙折子戏
    2021-01-13 20:12

    I was having the same problem, and found that it was a mongod issue.(I am running Ubuntu 16.04). Looking through the errors there was a directory missing. After adding the directory, I needed to change permissions, and finally, set the mongod service to start at boot.

    $ sudo mkdir -p /data/db
    $ sudo chown -R $USER /data/db
    $ sudo systemctl enable mongod.service
    

提交回复
热议问题