카테고리 없음

[Ubuntu] NVM 설치 & node 버전 변경

sangjun-pro 2024. 2. 26. 17:50

1. curl or wget 설치

ubuntu@ubuntu:~$ sudo apt-get install wget // wget
ubuntu@ubuntu:~$ sudo apt-get install curl // curl

 

 

2.  NVM 설치

- nvm 관련 github ( https://github.com/nvm-sh/nvm )

 

GitHub - nvm-sh/nvm: Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions - nvm-sh/nvm

github.com

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash // wget

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


ubuntu@ubuntu:~$ source ~/.bashrc // 설정파일 리로드
ubuntu@ubuntu:~$ nvm --version // 버전 확인
0.39.7

ubuntu@ubuntu:~$ nvm list-remote // 설치 가능한 버전 확인
v0.1.14
~
v21.6.2

 

3  node 재설치

ubuntu@ubuntu:~$ sudo apt-get remove nodejs // remove

ubuntu@ubuntu:~$ nvm install node // 최신 버전 설치
ubuntu@ubuntu:~$ nvm install 18.19.1 // 특정 버전 설치



ubuntu@ubuntu:~$ nvm current // 현재 버전 확인
ubuntu@ubuntu:~$ nvm use v21.6.2 // 특정 버전 사용
ubuntu@ubuntu:~$ nvm uninstall v10.1.1 // 특정 버전 삭제