connect ECONNREFUSED 127.0.0.1:27017'

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

    try this:

    mongod.exe --dbpath c:\data\db

    c:\data\db is the place where you put your db.

    and when you see something like this :

    2016-08-18T10:22:31.020+0800 I CONTROL  [main] Hotfix KB2731284 or later update is not installed, will zero-out data files
    2016-08-18T10:22:31.022+0800 I CONTROL  [initandlisten] MongoDB starting : pid=4356 port=27017 dbpath=c:\data\db 64-bit host=sevencai-PC0
    2016-08-18T10:22:31.022+0800 I CONTROL  [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
    2016-08-18T10:22:31.023+0800 I CONTROL  [initandlisten] db version v3.2.8
    2016-08-18T10:22:31.023+0800 I CONTROL  [initandlisten] git version: ed70e33130c977bda0024c125b56d159573dbaf0
    

    ......

    and then node yourserver.js

    maybe everything will be fine!

提交回复
热议问题