서버/호스팅
참조 : https://github.com/nodesource/distributions
nodejs의 rpm repository는 nodesource에서 제공한다.
아래 명령어를 실행하면 /etc/yum.repo.d/에 nodesource-el7.repo가 생성된다.
# curl -sL https://rpm.nodesource.com/setup_10.x | bash -
## Installing the NodeSource Node.js 10.x repo...
## Inspecting system...
+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release
+ uname -m
## Confirming "el7-x86_64" is supported...
+ curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_10.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'
## Downloading release setup RPM...
+ mktemp
+ curl -sL -o '/tmp/tmp.Vd2lwQeAOS' 'https://rpm.nodesource.com/pub_10.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'
## Installing release setup RPM...
+ rpm -i --nosignature --force '/tmp/tmp.Vd2lwQeAOS'
## Cleaning up...
+ rm -f '/tmp/tmp.Vd2lwQeAOS'
## Checking for existing installations...
+ rpm -qa 'node|npm' | grep -v nodesource
## Run `sudo yum install -y nodejs` to install Node.js 10.x and npm.
## You may also need development tools to build native addons:
sudo yum install gcc-c++ make
## To install the Yarn package manager, run:
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
sudo yum install yarn
repository가 설치되었으면 yum명령어로 nodejs를 설치한다.
# yum install nodejs