Wednesday, February 26, 2014

Solving "The term 'mongod' is not recognized as the name of a cmdlet, function, script file, or operable program.

Recently, while attempting to install an instance of MongoDB on a Windows Azure VM, I got a nice error.

mongod : The term 'mongod' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

I was in the bin directory of MongoDB at the command prompt and trying to run the database with the following statement -
mongod  --dbpath c:\MongoData\ --logpath C:\MongoLogs\mongolog.db

Ha! I forgot the .\!
mongod  --dbpath c:\MongoData\ --logpath C:\MongoLogs\mongolog.db

should have been
.\mongod  --dbpath c:\MongoData\ --logpath C:\MongoLogs\mongolog.db

I'm adding this here just in case anyone else is spacing out on a Wednesday wondering what in the world is going on when they are trying to run their Mongo databases.

Smooches,

Kila