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 trialJonathan Grieve
Treehouse Moderator 91,253 PointsProblem installing Mongo-Hacker on Windows.
I use windows 10 on my laptop but I have a feeling I'd have a similar probllm on my Windows 7 desktop.
My current version of npm is 2.15.1
After attempting to install hacker in the project directory I get the following.
$ npm install -g mongo-hacker
> mongo-hacker@0.0.13 install C:\Users\name\AppData\Roaming\npm\node_modules\mongo-hacker
> make install
'make' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "mongo-hacker"
npm ERR! node v4.4.4
npm ERR! npm v2.15.1
npm ERR! code ELIFECYCLE
npm ERR! mongo-hacker@0.0.13 install: `make install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mongo-hacker@0.0.13 install script 'make install'.
npm ERR! This is most likely a problem with the mongo-hacker package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! make install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs mongo-hacker
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls mongo-hacker
npm ERR! There is likely additional logging output above.
> mongo-hacker@0.0.13 postuninstall C:\Users\name\AppData\Roaming\npm\node_modules\mongo-hacker
> make uninstall
'make' is not recognized as an internal or external command,
operable program or batch file.
npm WARN continuing anyway mongo-hacker@0.0.13 postuninstall: `make uninstall`
npm WARN continuing anyway Exit status 1
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\name\Documents\mongo\npm-debug.log
Can anyone debug this for me and advise :)
8 Answers
Greg Clinton
8,091 PointsThis is how I got mongo working on Windows the same as OSX. (some info from myself most copied from random sites) It will take about 10mins.
- Use a decent terminal on windows. http://cmder.net/ is great and also lets you use unix commands.
To be able to type "mongod" and launch mongo from cmder, you need to set a path environment variable follow this guide - http://www.acemyskills.com/install-configure-and-start-mongodb-in-windows/
-Install make with choco.
choco install gnuwin32-make.portable
choco upgrade gnuwin32-make.portable
-
Install Mongo hacker
git clone https://github.com/TylerBrock/mongo-hacker.git
cd mongo-hacker
make
make install
Make your own mongo configuration file (.mongorc.js)
-In C:\Users\"computer-name"\
touch .mongorc.js
notepad .mongorc.js
copy and paste this info in the file http://pastebin.com/EFi2xCr8
(or just create a file in text editer copy and paste info and move to C:\Users\"computer-name"\ )
That's it, mongo hacker is now installed and working and you can start MongoDB with the "mongod" command from the terminal.
ryanjones6
13,797 Points[SOLVED] Installed - Using Cmder Application
Note: I installed cmder using the chocolatey package manager
Steps
- Make sure you are using cmd or powershell as Administrator
- Using choco: install MinGW
choco install mingw
- When prompted:
[y]es
|[n]o
- Type:y
Wait for it to install completely
Close the
cmder
applicationLocate the
MinGW
installation directory. It might be...
C:\tools\mingw64
- Open open the
bin
directory
C:\tools\mingw64\bin
Find the file:
mingw32-make.exe
-- you might not see the .exe unless you've enabled windows to display extensions.Make a copy of this file in the same directory and name it
make.exe
. So now you should have two files that do the exact same task.
mingw32-make.exe
make.exe
- Copy the the full path including the bin directory...
C:\tools\mingw64\bin
- Open your
System Environment Variables
- In your
System Propertie
window. Make sure theAdvanced
is selected. - Click on the
Environment Variables..
button at the bottom of the tab. -
The
Environment Variables
window will pop-up. It will be broken into two windows:User variables for Administrator
System variables
In the second window,
System variables
locate thePath
variable and select theEdit
button.Click the
New
button and paste in the path to the mingw64 bin directoryClick the
OK
button to confirmClck
OK
again. And clickOK
again.-
Open
cmder
and type:gcc --version
You should get an output telling you the version of MinGW
NodeJS -- is required to complete the next steps.
Run
cmder
as Administator. Locate the little green + button. To the right of the button is a tiny down-arrow. Click the array and select:1:{cmd}
>1:{Cmder as Admin}
Now run the command:
npm install -g mongo-hacker
- It should install now. -- This is what I did
For further assistance refer to this stackoverflow comment...
Aidan Lowson
10,379 PointsThanks for the clear instructions. All set up and running with mongo-hacker
now.
Gary Lau
2,307 PointsI guess the author does not target windows at all. After installing the make package, I got this error:
cat config.js base.js hacks/aggregation.js hacks/api.js hacks/auto_complete.js hacks/cmd_search.js hacks/color.js hacks/common.js hacks/count.js hacks
/dbref.js hacks/find_and_modify.js hacks/helpers.js hacks/index_paranoia.js hacks/old_aggregation.js hacks/prompt.js hacks/randomise.js hacks/sh_statu
s.js hacks/show.js hacks/uuid.js hacks/verbose.js > mongo_hacker.js
'cat' is not recognized as an internal or external command,
Seth Kroger
56,413 PointsI'm really sorry. This is a known issue on Windows and the author still needs to work on it. https://github.com/TylerBrock/mongo-hacker/issues/138 You can try installing Make for Windows and add it to your PATH.
Jonathan Grieve
Treehouse Moderator 91,253 PointsOh well, sadly no luck but thanks for your response. :) Adding Make to the environment variables doesn't seem to have done the trick but I've added a comment on the thread asking about a timetable for fixing the issue.
Seth Kroger
56,413 PointsYeah, it's a roll of the dice when that particular program (make for windows) hasn't been updated since XP was around.
Jonathan Grieve
Treehouse Moderator 91,253 PointsYes I wasn't overly optimistic when i went to the website. But never mind, it's not essential i get Hacker installed but might be nice. :-)
Alex Bjørlig
7,550 PointsAfter installing make for windows from here http://gnuwin32.sourceforge.net/packages/make.htm you just have to add make to the path. Then restart CMD and you are good to go!
Scott Cox
12,219 PointsI had luck installing Mongo-Hacker by getting Make via Chocolatey. Check out: https://chocolatey.org/packages/gnuwin32-make.portable
David Wright
4,437 Pointsdoes anyone know if this is safe? It seems to be directing to sourceforge.net download which I've heard isn't the most reputable site to download content
David Gilfillan
12,928 PointsI first installed Chocolatey via windows cmd prompt using the command:
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
Then to install make with choco i ran the following commands:
choco install gnuwin32-make.portable choco upgrade gnuwin32-make.portable
The npm install command then ran ok:
npm install -g mongo-hacker.
Note: to get the colours working (in cmder at least) I had to change the following settings in the .mongorc.js file:
force_color: true windows_warning: false
Tom Stanley
15,308 PointsTrying to install mongo-hacker on windows, I installed chocolatey and entered
choco install gnuwin32-make.portable
&
choco upgrade gnuwin32-make.portable
but npm i -g mongo-hacker
still fails with
npm ERR! mongo-hacker@0.0.15 install: `make install`
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the mongo-hacker@0.0.15 install script.
I'm stumped. Guess I buy a Mac?
Ross King
22,165 PointsRoss King
22,165 PointsThanks for this, it's working great.
Only problem now is that it has a ridiculously long filepath before the version number on my CLI, any idea how to remove this? Thanks