markdown macOS Mojave(Dev)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown macOS Mojave(Dev)相关的知识,希望对你有一定的参考价值。

# Install Guide

> **macOS Mojave 10.14 - kevyworks**

Preparing Environment
--

**1. Install Homebrew**
```sh
$ /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**
```sh
$ 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**
```sh
$ 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+**
```sh
$ 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.

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

My `.bash_profile` looks like this:

```sh
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: https://github.com/atom/atom/issues/17486#issuecomment-424140110

```sh
$ defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO
```

References
--
- [github - valet-plus](https://github.com/weprovide/valet-plus#installation)
- [xcode - stack overflow](https://stackoverflow.com/questions/50780183/cannot-install-brew-on-mojave-with-xcode10)

以上是关于markdown macOS Mojave(Dev)的主要内容,如果未能解决你的问题,请参考以下文章

markdown 在macOS Mojave上,rbenv install 2.6.1挂起“使用来自homebrew的realline”

如何在 OSX Mojave 上安装 MySQL 5.6?

如何在 macOS 10.14.4 Mojave 上使用 fink

将MacOS Catalina 降级为 Mojave

macOS Mojave:从 High Sierra 更新到 Mojave 后,活动开发者路径无效

如何将MacOS Catalina降级为Mojave