Skip to content

Instantly share code, notes, and snippets.

@kevyworks
Last active May 2, 2020 18:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevyworks/476716bfb0383d3fda699e4fcacc6470 to your computer and use it in GitHub Desktop.
Save kevyworks/476716bfb0383d3fda699e4fcacc6470 to your computer and use it in GitHub Desktop.
macOS Mojave (Dev)

Install Guide

macOS Mojave 10.14 - kevyworks

Preparing Environment

1. Install Homebrew

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile
$ source ~/.bash_profile

2. Install Essentials

$ brew install git
$ brew install wget
$ brew cask install google-chrome
$ brew cask install firefox
$ brew cask install visual-studio-code

3. Install Node Version Manager

$ mkdir ~/.nvm
$ echo $'\n# NodeJS' >> ~/.bash_profile
$ echo "export NVM_DIR=~/.nvm" >> ~/.bash_profile
$ echo "source $(brew --prefix nvm)/nvm.sh" >> ~/.bash_profile
$ source ~/.bash_profile
$ brew install nvm
$ nvm install --lts && node -v

4. Install PHP, Composer & Valet+

$ brew install php@7.1
$ echo $'\n# PHP' >> ~./bash_profile
$ echo 'export PATH="/usr/local/opt/php@7.1/bin:$PATH"' >> ~/.bash_profile
$ echo 'export PATH="/usr/local/opt/php@7.1/sbin:$PATH"' >> ~/.bash_profile
$ source ~/.bash_profile
$ brew install composer
$ echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bash_profile
$ source ~/.bash_profile
$ composer global require weprovide/valet-plus
$ valet fix
$ valet install
$ valet use 7.1

Aw Snap! Got Error...

Incase you encountered problems while installing php or valet+. Revert PHP by removing all inside "# PHP" at ~/.bash_profile file first (e.g.):

# PHP
export PATH="/usr/local/opt/php@7.1/bin:$PATH"
export PATH="/usr/local/opt/php@7.1/sbin:$PATH"
...

Execute below commands to revert, then follow #4 again.

$ brew uninstall php@7.1
$ brew cleanup
$ which php

My .bash_profile looks like this:

export PATH="/usr/local/sbin:$PATH"

# NodeJS
export NVM_DIR=~/.nvm
source /usr/local/Cellar/nvm/0.33.11/nvm.sh

# PHP
export PATH="/usr/local/opt/php@7.1/bin:$PATH"
export PATH="/usr/local/opt/php@7.1/sbin:$PATH"
export PATH="$PATH:$HOME/.composer/vendor/bin"

Font Smoothing

If macOS Mojave font appears just too thin for you, below command will fix it. Restart Atom/VSCode and Chrome. Credits: atom/atom#17486 (comment)

$ defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment