0

I've been trying to install my 1st MEAN app. I installed mongoDB via home brew. using https://stackoverflow.com/a/10425148/3915717

Here is as far as I got:

Before you install the dependencies and fire up the server we can help you with setting up your first admin user.
? Cool, bring it on: y
? Please provide your email so we can create your first admin user: b@v.dd
? Please provide your username so we can create your first admin user: n
    Error Connecting to database: { [MongoError: connect ECONNREFUSED] name: 'MongoError', message: 'connect ECONNREFUSED' }

grep mongo /etc/passwd returns nothing

Community
  • 1
  • 1
SuperUberDuper
  • 9,242
  • 9
  • 39
  • 72

1 Answers1

2

Have you started the MongoD Server? Make sure that it's running. This error generally occurs because MongoD is not running due to which the client application isn't able to connect to it.

Make sure you have MongoDB installation directory path saved in your PATH environment variable. Then fire up command prompt and type in

mongod

This will start MongoD Server on it's default port 27017

This should rectify your connection error. Hope this helps.

SiddAjmera
  • 38,129
  • 5
  • 72
  • 110
  • Can you please post a screenshot? Are you sure the MongoD Server is running? Coz this error generally occurs when the MongoD server is not running. – SiddAjmera Feb 28 '16 at 10:02
  • opps sorry, I see this: `2016-02-28T09:31:07.657+0000 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating` – SuperUberDuper Feb 28 '16 at 20:29
  • I have drwxr-xr-x 2 root wheel 68 28 Feb 20:31 /data/db/ – SuperUberDuper Feb 28 '16 at 20:32
  • and now get `[initandlisten] exception in initAndListen: 98 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating ` – SuperUberDuper Feb 28 '16 at 20:38
  • I got it working, I changed permision of that folder to $USER – SuperUberDuper Feb 28 '16 at 20:42