Hello World...

nvm (mac) 본문

programming

nvm (mac)

FaustK 2019. 12. 26. 08:47

nvm은 Node Version Manager 의 줄임말로 말 그대로 node 버전 관리를 쉽게 해주는 툴이다. 

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

 

설치

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

 

설치 후

$ vim ~/.bash_profile

아래 내용 입력

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

 

입력 후

$ source ~/.bash_profile

 

잘 설치가 되었는 지 확인해보기.

$ nvm list

이미 node 12버전이 설치되어 있어서 표시됨.

 

 노드 설치

$ nvm install node   // 현재 최신 버전의 노드 설치
$ nvm install 8.9.1   // 해당 버전의 노드 설치 

 

원하는 버전 사용하기

$ nvm use 12
$ nvm run node --version

 

'programming' 카테고리의 다른 글

소켓과 웹소켓  (0) 2020.02.03
자료구조(Data Structure)  (0) 2019.12.30
JEST toBe, toEqual  (0) 2019.12.26
npm 글로벌 패키지 확인 및 삭제하기  (0) 2019.12.26
eslint, prettier and airBnB 설치  (0) 2019.12.26
Comments