본문 바로가기
IT/NodeJS

Ubuntu 에 NodeJs 20 버전 설치하기

by 골든크랩 2023. 12. 19.
728x90
반응형

 

참고)

https://github.com/nodesource/distributions

 

GitHub - nodesource/distributions: NodeSource Node.js Binary Distributions

NodeSource Node.js Binary Distributions. Contribute to nodesource/distributions development by creating an account on GitHub.

github.com

 

root 계정이면, sudo 는 빼도 됨

 

-- Nodesource GPG key 다운로드 및 import

sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg

 

--레포지토리 성생, 아래 20은 버전...다른것을 선택해도 됨...예를 들어, 16, 18, 20, 21

NODE_MAJOR=20
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list

 

-- update와 설치

sudo apt-get update
sudo apt-get install nodejs -y

 

=======================================================

버전 확인 : node -v

yarn 슬치 : npm install -g yarn -> 버전확인 yarn -v (1.22.21)

 

728x90
반응형

댓글