CentOS - nodejs

분류없음 2017.12.10 10:34 Posted by 파란크리스마스

출처 : n 을 이용한 nodejs 설치 및 관리 CentOs yum install ... - Blue Breeze
linuxism :: node.js - CentOS에서 설치(install in linux)

node.js 설치 확인

# rpm -qa | grep nodejs
# node -v
-bash: node: command not found

node.js 설치

오류 확인

# yum install nodejs
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: ftp.kaist.ac.kr
 * extras: ftp.kaist.ac.kr
 * updates: ftp.kaist.ac.kr
base                                                                                                  | 3.7 kB     00:00     
extras                                                                                                | 3.4 kB     00:00     
updates                                                                                               | 3.4 kB     00:00     
No package nodejs available.
Error: Nothing to do

오류 해결

# curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -

## Installing the NodeSource Node.js 6.x repo...
 
... 생략 ...
 
## Run `yum install -y nodejs` (as root) to install Node.js 6.x and npm.
## You may also need development tools to build native addons:
##   `yum install -y gcc-c++ make`

node.js 설치

# yum install -y nodejs

node.js 라이브러리 컴파일용 g++설치 (옵션)

# yum install -y gcc-c++ make

node.js 설치확인

# node -v
v6.12.2