DEV Community

sunj
sunj

Posted on

ubuntu20.04 - node.js & nvm install, 2022-11-22

# 필수 패키지 설치
sudo apt-get update
sudo apt-get install -y build-essentail
Enter fullscreen mode Exit fullscreen mode
# root에서 실행
apt-get install wget

# 자동설치 스크립트 다운로드 후 실행
wget https://deb.nodesource.com/setup_16.x(버전은 각자)
sudo ./setup_16.x
rm setup_16.x
Enter fullscreen mode Exit fullscreen mode
#apt를 통한 nodejs 설치
sudo apt-get update
sudo apt install -y nodejs
Enter fullscreen mode Exit fullscreen mode
#nvm 설치
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
Enter fullscreen mode Exit fullscreen mode
source ~/.bashrc
Enter fullscreen mode Exit fullscreen mode
nvm install node  # 최신 버전 설치
nvm install --lts # 최신 LTS 버전 설치
nvm install 16.14.0  # 특정 버전 설치
nvm install 16  # 특정 버전 16의 최신 릴리즈 설치
Enter fullscreen mode Exit fullscreen mode
node -v
# v16.17.1
npm -v
# 8.3.1
Enter fullscreen mode Exit fullscreen mode

참고 : https://foxybearkim.tistory.com/17
https://iter.kr/%EC%9A%B0%EB%B6%84%ED%88%AC-nvm-node-js-%EC%84%A4%EC%B9%98-%EC%84%A4%EC%A0%95/

Top comments (0)