DevOps/MacOS

[MacOS] 내가 보려고 만든 MacOS 초기설정 (2) - 환경설정

문스코딩 2024. 3. 18. 14:25

Dev

git

 

git config 설정

$ git config --global user.name "mooncoding"
$ git config --global user.email "mooncoding@naver.com"

$ git config user.name
$ git config user.email

 

brew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# 필요하다면 Next steps을 실행하세요
==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
    (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/USER/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh
    
# 이 부분을 실행하세요
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/USER/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"

 

nvm (w. brew)

 

nvm을 설치하고 환경변수를 셋팅합니다.

$ brew install nvm

$ mkdir ~/.nvm

$ vi ~/.bash_profile # 또는 ~/.zshrc

---.bash_profile
# "brew intall nvm" 명령어 결과에 적용할 환경변수 값이 가이드 된다. (아래 경로와 다를 수 있으니 유의 ⚠️)
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh"  # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion
---

$ source ~/.bash_profile

$ nvm -v

 

node의 기본 버전을 설정합니다.

$ nvm alias default <version> # nvm alias default 18.18.2

$ nvm use default

$ nvm current # node -v

 

node

$ nvm install <v>
$ nvm use <v>

 

yarn, wget

$ brew install yarn
$ brew install wget

 

on-my-zsh > terminal tool

# install
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# theme
$ vi ~/.zshrc

=== .zshrc ===
$ ZSH_THEME="af-magic"
=== .zshrc ===

Terminal

iOS 시뮬레이터

# appstore > xcode 먼저 다운로드 및 실행
$ open -a simulator

 

hosts 설정

$ vi /etc/hosts

---hosts
127.0.0.1 	local.moonscode.tistory.com
---

 

반응형