CentOS 7
Sponsored Link

Install Node.js 82017/10/08

 
Install ServerSide JavaScript Environment Node.js 8 (LTS).
[1] It's possible to install from CentOS SCLo Software Collections.
It's OK to install it even if another version of Node.js is already installed because 8.x is located on another PATH.
# install from SCLo

[root@dlp ~]#
yum --enablerepo=centos-sclo-rh -y install rh-nodejs8
[2] Packages from Software Collections are installed uder the /opt directory.
To use it, Load environment variables like follows.
# load environment variables

[root@dlp ~]#
scl enable rh-nodejs8 bash
[root@dlp ~]#
node -v

v8.3.0
[root@dlp ~]#
which node

/opt/rh/rh-nodejs8/root/usr/bin/node
[3] If you'd like to enable Node.js 6 automatically at login time, configure like follows.
[root@dlp ~]#
vi /etc/profile.d/rh-nodejs8.sh
# create new

#!/bin/bash

source /opt/rh/rh-nodejs8/enable
export X_SCLS="`scl enable rh-nodejs8 'echo $X_SCLS'`"
Matched Content