개발

nvm 설치 오류 ) HEAD detached at FETCH_HEAD

대왕판다 2021. 6. 27. 16:51

nvm을 설치하기 위해 해당 repo로 이동 ( https://github.com/nvm-sh/nvm#install--update-script )

그리고 

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

을 실행했으나 

 

HEAD detached at FETCH_HEAD  라는 오류가 발생해서 설치가 안됐다.

 

그리고 https://github.com/nvm-sh/nvm/issues/2486 요기서 해결책 발견

리눅스 콘솔창에서 

sudo apt update

sudo apt install build-essential checkinstall libssl-dev

git clone https://github.com/nvm-sh/nvm.git .nvm

git checkout v0.38.0

 

을 차례대로 실행시켜주고 

zshrc를 열어

export NVM_DIR="$HOME/.nvm"

[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

요 녀석들을 붙여넣고 저장해준 다음 터미널을 재시작.

리눅스에서 nvm을 실행해보면 설치가 된걸 확인할수있다.