1

I've just switched to MacOs - never used it before and I'm using Macbook M1 Pro, so a newbie here. Also, I've only started with web dev so I'm fairly new in this field as well.

Now, how should I proceed in order to set-up a local development enviroment - I plan to use mainly Laravel & VueJs?

Things I've done so far:

  1. Installed VS code
  2. Installe MAMP
  3. Cloned my Git repository with project I was working on (Windows 10)
  4. This is the part where I need help - I think I'm supposed to install Homebrew, but even if I follow the instructions on their website I can't get it working properly. It's installed but as soon as I close & reopen the terminal, it throws zsh: command not found: brew. The commands I'm used to - php artisan xyz or npm run watch don't work

Do you guys have some guide or step-by-step tutorial of what should I do in order to get my Laravel&Vue git project up & running on a localhost?

Marek42
  • 51
  • 3
  • 1
    I recommend you to use `Docker`, that is the common "virtual machine" technology used among developers in a serious team (not amateur). There are plenty of good tutorials out there for you to see about this, so you can get to learn it more and fast. I recommend you to drop MAMP and use _Docker Compose_. You will learn a lot ! – matiaslauriti Jun 12 '21 at 19:15
  • I'll definitely give Docker a try with my next project, right now I feel like it would be super difficult to move the whole stuff to docker - especially with my little to no experience. Thank you for the suggestion though – Marek42 Jun 13 '21 at 12:15

2 Answers2

1

brew is installed in /usr/local/Homebrew/bin/brew (symlinked to /usr/local/bin/brew). Make sure /usr/local/bin is in your PATH, so that brew and newly installed Homebrew packages are available on the command line. This is typically setup by the ~/.zshrc file.

Troubleshooting steps:

  1. Edit $HOME/.zshrc.

  2. If export PATH is not found, add the following line. The important part is to ensure /usr/local/bin is present (and that :$PATH is last) to give it higher precedence. If the export PATH line exists, but commented, uncomment it.

    export PATH=$HOME/bin:/usr/local/bin:$PATH
    
  3. Restart your shell. .zshrc is loaded automatically at shell startup.

  4. Check for brew with the which command:

    $ which brew
    /usr/local/bin/brew
    
tony19
  • 125,647
  • 18
  • 229
  • 307
  • Hey Tony, thanks for this - here's my output: 1. I install HomeBrew, which leads to: `==> Next steps: - Add Homebrew to your PATH in /Users/jankom/.zprofile: echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/jankom/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)"` 2. If I run the recommended commands by homebrew it will create .zprofile file with the following: `eval "$(/opt/homebrew/bin/brew shellenv)"` 3. Just to be sure I checked `which brew` -> `/opt/homebrew/bin/brew` 4. .zshrc file didn't exist, so I created one according to your advice, but same result – Marek42 Jun 13 '21 at 07:28
0

Update

This suggestion here fixed my issues: https://stackoverflow.com/a/66521797/9682588

So, what I did was:

echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.bash_profile && source ~/.bash_profile
Marek42
  • 51
  • 3