NVM(node version manager)이용 nodejs 설치(ft. centos7)# Script2024. 4. 16. 17:10
Table of Contents
728x90
반응형
## 아래와 같이 에러 발생시 호환되는 버전으로 재설치 ##
node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by node)
node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by node)
node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by node)
node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by node)
## nvm 설치 ##
[darksharavim]curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
## /etc/bashrc 또는 /etc/profile 맨 아래 추가 ##
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"
## nvm 버전확인 ##
[darksharavim]nvm --version
## nodejs 설치
[darksharavim]nvm install node
## 설치할수 있는 버전 목록 확인 ##
[darksharavim]nvm ls-remote
v0.1.14
v0.1.15
v0.1.16
v20.9.0 (LTS: Iron)
v20.10.0 (LTS: Iron)
v20.11.0 (LTS: Iron)
v20.11.1 (LTS: Iron)
v20.12.0 (LTS: Iron)
v20.12.1 (LTS: Iron)
v20.12.2 (Latest LTS: Iron)
v21.0.0
v21.1.0
[darksharavim]nvm install --lts
## 버전별 설치
[darksharavim]nvm install 14.19.3
## 설치된 버전 확인 ##
[darksharavim]nvm ls
-> v12.22.12
v14.21.3
v16.20.2
v21.7.3
system
default -> node (-> v21.7.3)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v21.7.3) (default)
stable -> 21.7 (-> v21.7.3) (default)
lts/* -> lts/iron (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12
lts/fermium -> v14.21.3
lts/gallium -> v16.20.2
lts/hydrogen -> v18.20.2 (-> N/A)
lts/iron -> v20.12.2 (-> N/A)
## 하위항목까지 전부 확인하게 됨 ##
[darksharavim]npm ls -g
## 설치한 모듈만 별도로 볼려면 아래와 같이 하면 됨 ##
[darksharavim]npm ls -g --depth=0
/root/.nvm/versions/node/v12.22.12/lib
└── npm@6.14.16
https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating
728x90
반응형
@다크쉐라빔 :: 다크쉐라빔의 주절주절
안녕하세요. 이곳은 IT위주의 잡다한 정보를 올려두는 개인 블로그입니다.
포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!