How to run "brew" command in windows..?
Asked Answered
C

6

58

It shows "'brew' is not recognized as an internal or external command" in windows command prompt.

enter image description here

I am trying to install codeigniter-reactjs-example from github, where first command is brew. How to run this command to install that project in Windows..?

Checkpoint answered 3/7, 2017 at 13:5 Comment(8)
That example is on an OS X machine. Homebrew is a package manager for Mac OS XSevilla
@Andrew Li... Then how to install in windows..?Checkpoint
You don't, Homebrew is only for Mac.Sevilla
you have to install it manually, there is no package manager in windowsGadson
You could either use the alternatives mentioned in comments (and here) or set up a virtual machine that supports the brew package managerWhistle
scoop is pretty much the closest thing you can find on Windows at the moment.Bogbean
There is something called chocolatey. It does the same thing.Nigritude
With Homebrew 2.0 and Windows 10 WSL, you now have brew "on Windows": see my answer belowAirstrip
M
69

Edit: Homebrew is also usable on Windows Subsystem for Linux (WSL) since version 2.0.0 (released February 2019), as detailed by @VonC's answer below. The instructions for installation/use are available at:


Homebrew is MacOS only command line installer application and it doesn't exist for Windows.

The Windows alternatives are:

Source: https://laracasts.com/discuss/channels/laravel/homebrew-install-on-windows-os

Maurya answered 3/7, 2017 at 13:9 Comment(2)
Looks like this answer is copy and pasted from another site (word for word): laracasts.com/discuss/channels/laravel/…. Please make sure to cite your source if you are referencing something else.Machinegun
What about winget?Cobaltous
A
10

It shows "'brew' is not recognized as an internal or external command" in windows command prompt.

Not anymore, 19 months later (Feb. 2019, compared to July 2017)

At least, not on Windows 10, in a WSL (Windows Subsystem for Linux) session.
As mentioned by Mike McQuaid

Homebrew 2.0.0 has been released (at @FOSDEM!) with official Linux and Windows 10 WSL support, brew cleanup running automatically (opt-out with HOMEBREW_NO_INSTALL_CLEANUP), no more options in Homebrew/core and no longer running on OS X 10.8 and older.

See Homebrew 2.0.0.

“Homebrew on Linux” is called “Linuxbrew”.
You can install it in your home directory, so it does not require sudo, and use it to install software that your host distribution’s package manager does not provide. Linuxbrew uses its own repository for formulae: Linuxbrew/homebrew-core.

So again, this is not native Windows support, but Linux (through the WSL layer, on Windows 10).

Airstrip answered 4/2, 2019 at 21:43 Comment(0)
F
3

You can Install Brew on windows subsystem i.e in Ubuntu or Kali linux by following these steps.

1: $ sudo apt-get install build-essential procps curl file git -y
2: $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
3: $ echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/$USER/.profile
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
4: $ brew update

I have installed in both the linux(Windows subsystem)

To Upgrade

$ brew upgrade PACKAGE

To Uninstall

$ brew uninstall PACKAGE

Finally, if you ever want to remove Homebrew from Linux, the command is:

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
Fultz answered 1/10, 2022 at 14:54 Comment(0)
M
1

As mentioned in the comments, Homebrew is a package manager for OSX, much like Aptitude in linux. You can't install Homebrew on Windows and never will be able to so you need to find a new way to accomplish what you are doing. I think you're trying to work with Google's V8 Javascript engine so why not try: https://github.com/phpv8/v8js

Michaelemichaelina answered 3/7, 2017 at 13:11 Comment(1)
Tried your link, there is no accurate procedure to install V8Js. But used another link which one i used to installCheckpoint
D
0

Homebrew is a package manager for OS X. Windows can't use Homebrew. Even if there was a way to get pass that, the packages wouldn't work.

This link below might help you find an alternative.

http://alternativeto.net/software/homebrew/

Dara answered 3/7, 2017 at 14:6 Comment(0)
P
-1

Use this

  • Download git bash

  • Run below command, this will install homebrew to your PC

  • now this can help you run brew command

bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  • If you want to run directly without bash then It can be done using cmd also

  • If following with cmd then you need to add the location of homebrew downloaded folder to your environment path variables

Try this in windows CMD

curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh

Now add this folder location "C:\Users\[NAME]\homebrew\" to path variable

TO add in Path Variables Follow below:

enter image description here

enter image description here

Penniepenniless answered 15/6, 2020 at 22:20 Comment(6)
it installs homebrew in your PC[WINDOWS]Penniepenniless
Now you can run brew command [Provided You add it in your path variable]Penniepenniless
doesn't work. I get this error: "Homebrew is only supported on macOS and Linux"Bioplasm
we shouldn't, It doesn't work, window's user have alternative tool like chocolatey chocolatey.orgNeutralism
Yes I know we can use choco, or scoop for windows, but this brew worked on my PC 😅Penniepenniless
I guess I have installed git cmd and linux subsystemPenniepenniless

© 2022 - 2024 — McMap. All rights reserved.