Mongod command not found (Windows7)(node.js)
Solution 1
Add the mongo's path to the PATH
environment variable.
Reference: https://youtu.be/sBdaRlgb4N8?t=120
Solution 2
You need to use ./
to run mongod.exe
file. use ./mongod.exe
It'll run successfully.
Solution 3
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.
Solution 4
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
Tristan Marr
Updated on June 02, 2020Comments
-
Tristan Marr about 4 years
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.
-
Tristan Marr about 9 yearsThanks! I was looking for a video just like this.
-
Soren over 6 yearsIs does this not happen automatically? That would be quite useful.
-
logos_164 about 6 yearsIs this specific to Windows? i.e. if we were running this on Ubuntu would there be a similar process that you know of? Just out of curiousity because I run a lot of development on Ubuntu using Virtual Box
-
Justin L. almost 6 yearsI just downloaded mongo 4.0.2 and neither
mongo
normongod
are in the bin folder atC:\Program Files\MongoDB\Server\4.0\bin
-- any ideas why that might be and how i can fix it?