Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialEdgar Burton
1,615 PointsWindows User - Totally lost with this tutorial. Does home brew exist for windows. Not clear on how to run commands in
Tutorial seems to be tailored for mac users. Unable to run any commands in Mongo. Using Windows 10. lost with this tutorial.
6 Answers
Daniel Breen
14,943 PointsThe installation instructions for Windows don't explain how to make it easier to run mongod and mongo from the shell (powershell/command prompt) since we don't have homebrew. Hopefully this will help someone else down the road.
Windows 10 MongoDB PATH setup
- Find out where mongod.exe exists. For me it was
C:\Program Files\MongoDB\Server\3.2\bin
on 64-bit
1a. Right-click the file it finds and selectOpen File Location
1b. Copy the path from File Explorer's address bar by left-clicking to the right of the path then selecting all of it and pressing CTRL+C
- Hit the windows key and type
environment
. SelectEdit the system environment variables
(do not selectEdit environment variable for your account
) - Click
Environment Variables
- From the list, select the
PATH
variable, then clickEdit...
- Click
New
- CTRL+V to paste the path
- Click
OK
- You can now run
mongod
,mongo
, and all of the .exe files that exist in the\bin\
folder for MongoDB from powershell and command prompt
Ken Alger
Treehouse TeacherEdgar;
Don't get frustrated yet! There are lots of folks here willing to walk you through any issues. A few problem solving questions.
- Were you able to successfully install MongoDB? If not, see the link Cena Mayo posted.
- If you are trying to run commands against a MongoDB database do you have an instance of the MongoDB server running? If not from the Windows command line you can start one with the
mongod
command. - Are you trying to run MongoDB commands in the Mongo Shell? That can be started with the
mongo
command.
Post back with an update and your fellow Treehousers will be happy to assist!
Ken
brianturner4
18,570 PointsScoop seems to be an alternative to Homebrew for Windows users. I haven't had experience with it but people compare it to Homebrew and like its ease to use. But homebrew is only for os.
Daniel Breen
14,943 PointsAlso chocolatey
https://chocolatey.org/packages/mongodb.
Looks like scoop is more user friendly from my 5 minutes of research :)
Cena Mayo
55,236 PointsYou might also take a look at the MongoDB install instructions for Windows.
Homebrew is a way for Mac users to automatically download various software packages via the command line. It sounds like what you may be having difficulties with is using Windows' console application(i.e. command line). Is that the case?
Best, Cena
Sherrie Gossett
14,924 PointsHi Edgar: I used Homebrew on my Mac. Apparently it is only for os. Echoing what Brian said above, Scoop may be a solution for you: https://www.outcoldman.com/en/archive/2014/07/20/scoop/
Iain Simmons
Treehouse Moderator 32,305 PointsTry adding the 'bin' directory from your MongoDB installation files to your system PATH
variable so that you can just use the command mongod
to run the server and then mongo
to run the shell.
Konstantin Kovar
16,003 PointsKonstantin Kovar
16,003 PointsThis just saved my sanity, thanks a million!