
homebrew가 설치되있다는 하에
nvm 설치
$ sudo curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash.bash_profile 수정
나노로 .bash_profile 열기
nano ~/.bash_profile다음 내용 추가
export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm저장하고 나가기
ctrl + xyenter.bash_profile 재시작
source ~/.bash_profile확인
nvm ls
16.13.0 버전 설치
nvm install 16.13.0버전 사용 및 변경
nvm use 사용할버전현재 실행중인 버전 확인
node -v
n 설치
brew install n.bash_profile 수정
나노로 .bash_profile 열기
nano ~/.bash_profile다음 코드 추가
export N_PREFIX=$HOME/.n export PATH=$N_PREFIX/bin:$PATH저장하고 나가기
ctrl + xyenter.bash_profile 재시작
source ~/.bash_profile
16.13.0 버전 설치
sudo n 16.13.0최신 버전 설치
sudo n latestlts 버전 설치
sudo n lts버전 사용 및 변경
sudo n입력
up/down키로 원하는 버전 선택현재 실행중인 버전 확인
node -v