개발을 간바루Joy 하게

[Centos7] nodejs 최신버전 설치 본문

프로그래밍/Linux

[Centos7] nodejs 최신버전 설치

New! Game 2021. 4. 8. 14:57

//nodejs 삭제후 최신버전 설치

 

먼저 캐시를 지워줍니다.

npm cache clean -f

 

 

 

 

현재 설치되어있는 nodejs를 삭제 해줍니다.

sudo yum remove -y nodejs npm

 

 

Nodejs 공식 홈페이지에 접속하여 설치할 버전을 체크합니다 (ctrl+f 로 centos 검색)

저는 14버전으로 설치를 진행하였습니다.

github.com/nodesource/distributions/blob/master/README.md

 

nodesource/distributions

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

github.com

 

nodejs를 재설치 해줍니다.

sudo yum install -y nodejs

 

설치확인

node -v
npm -v

 

//2023-04-11 추가글

nodejs 18버전은 amazon linux2, centos7등 호환이 안되는 이슈가있음 밑 링크 참고

https://github.com/nodejs/node/issues/43246

 

NodeJS 18 revert to building on CentOS 7, RHEL 7, Ubuntu Bionic 18.04, other other LTS distros · Issue #43246 · nodejs/node

What is the problem this feature will solve? Moving to RHEL 8 has raised the glibc version being linked against (2.28). The official Node.js Linux release binaries will only run on Linux distributi...

github.com

 

'프로그래밍 > Linux' 카테고리의 다른 글

Centos7 LEMP + laravel 셋팅  (0) 2022.08.06
Centos7 Root 계정 SSH 원격 접속 제한  (0) 2021.03.31
[Centos7] 줫같은 SElinux 해제  (0) 2020.05.20
Centos7 php-fpm(Nginx) 설정  (0) 2020.05.13
Centos7 php7.2 설치  (0) 2020.05.12