connect ECONNREFUSED 127.0.0.1:27017'

前端 未结 8 1082
南旧
南旧 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:17

    I was also facing the same issue, when I was executing node server on my project directory. For me the MongoDB service was not started, that makes this issue.

    So I had to run services.msc and activated the service.

    After that I was able to run my command.

    D:\SVenu\MyApp>node server
    Saving User
    App is listening on port: 3000
    Already Exist
    Already Exist
    Already Exist
    Already Exist
    Done save
    
    0 讨论(0)
  • 2021-01-13 20:21

    I know this issue is old, but i came across a similar issue and the above solutions did not work for me, I'm using Ubuntu 20.04 LTS.

    What i did to make it work was just running mongo service using this command:

    $ mongod
    

    Then everything worked fine

    0 讨论(0)
提交回复
热议问题