Tristan Marr
Tristan Marr

Reputation: 125

Mongod command not found (Windows7)(node.js)

I have been trying to get my mongodb going for about a day now. The problem seems to be that the mongod command is not found. I have the npm package mongoose installed in my node.js build. When i try to start the server with the mongod command the git bash returns that the command is not found.

I have been googleing for an answer and it looks like i need to make mongodb into a command, i'm not sure how to do this. Any advice would help.

I have downloaded the mongodb into my files it's located here C:\Program Files\MongoDB\Server\3.0 ( Not sure if that matters or not).

Really not sure what to do from here.

Upvotes: 13

Views: 28092

Answers (4)

Peter Kulik
Peter Kulik

Reputation: 299

Add the mongo's path to the PATH environment variable.

Reference: https://youtu.be/sBdaRlgb4N8?t=120

Upvotes: 21

AN Jay
AN Jay

Reputation: 63

Set the path variable. When you open the bin folder it has a file called mongod.pdb instead of mongod.exe But don't worry. It could be rectified by adding the path to the environment variables. By appending the path of the bin folder (C:\Program Files\MongoDB\Server\3.4\bin) you are allowing the computer to run the executable files in that particular folder.

shutting down with code:100

When you run mongod.exe if the DB is shutting down with code:100, then you need to make two folders (data and db) to create databases. Use mkdir C:\data\db

Upvotes: 1

AN Jay
AN Jay

Reputation: 63

When you open the bin folder it has a file called mongod.pdb instead of mongod.exe But don't worry. It could be rectified by adding the path to the environment variables. By appending the path of the bin folder (C:\Program Files\MongoDB\Server\3.4\bin) you are allowing the computer to run the executable files in that particular folder.

Upvotes: 5

Sunil_Banjare
Sunil_Banjare

Reputation: 111

You need to use ./ to run mongod.exe file. use ./mongod.exe It'll run successfully.

Upvotes: 9

Related Questions