node.js 5.x系 インストール
node.js 5.x系 のインストールです。 CentOS 6.x対応 CentOS 7.x対応
1 node.js 5.x リポジトリをインストール
「curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -」と入力
[root@centos ~]# curl --silent --location https://rpm.nodesource.com/setup_5.x | bash - ## Installing the NodeSource Node.js 5.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_5.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm' ## Downloading release setup RPM... + mktemp + curl -sL -o '/tmp/tmp.WjEfCgXjPg' 'https://rpm.nodesource.com/pub_5.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm' ## Installing release setup RPM... + rpm -i --nosignature --force '/tmp/tmp.WjEfCgXjPg' ## Cleaning up... + rm -f '/tmp/tmp.WjEfCgXjPg' ## Checking for existing installations... + rpm -qa 'node|npm' | grep -v nodesource ## Run `yum install -y nodejs` (as root) to install Node.js 5.x and npm. ## You may also need development tools to build native addons: ## `yum install -y gcc-c++ make` [root@centos ~]#
2 yumにてインストール
「yum -y install nodejs」と入力
[root@centos ~]# yum install -y nodejs 読み込んだプラグイン:fastestmirror nodesource | 2.5 kB 00:00:00 nodesource/x86_64/primary_db | 22 kB 00:00:00 Loading mirror speeds from cached hostfile * base: ftp.nara.wide.ad.jp * extras: ftp.nara.wide.ad.jp * updates: ftp.nara.wide.ad.jp 依存性の解決をしています --$gt; トランザクションの確認を実行しています。 ---$gt; パッケージ nodejs.x86_64 0:5.6.0-1nodesource.el7.centos を インストール --$gt; 依存性解決を終了しました。 依存性を解決しました =========================================================================================================================================================================================================== Package アーキテクチャー バージョン リポジトリー 容量 =========================================================================================================================================================================================================== インストール中: nodejs x86_64 5.6.0-1nodesource.el7.centos nodesource 8.6 M トランザクションの要約 =========================================================================================================================================================================================================== インストール 1 パッケージ 総ダウンロード容量: 8.6 M インストール容量: 30 M Downloading packages: 警告: /var/cache/yum/x86_64/7/nodesource/packages/nodejs-5.6.0-1nodesource.el7.centos.x86_64.rpm: ヘッダー V3 RSA/SHA1 Signature、鍵 ID 34fa74dd: NOKEY================- ] 402 kB/s | 8.5 MB 00:00:00 ETA nodejs-5.6.0-1nodesource.el7.centos.x86_64.rpm の公開鍵がインストールされていません nodejs-5.6.0-1nodesource.el7.centos.x86_64.rpm | 8.6 MB 00:00:21 file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL から鍵を取得中です。 Importing GPG key 0x34FA74DD: Userid : "NodeSource $lt;gpg-rpm@nodesource.com>" Fingerprint: 2e55 207a 95d9 944b 0cc9 3261 5ddb e8d4 34fa 74dd Package : nodesource-release-el7-1.noarch (installed) From : /etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL Running transaction check Running transaction test Transaction test succeeded Running transaction 警告: RPMDB は yum 以外で変更されました。 インストール中 : nodejs-5.6.0-1nodesource.el7.centos.x86_64 1/1 検証中 : nodejs-5.6.0-1nodesource.el7.centos.x86_64 1/1 インストール: nodejs.x86_64 0:5.6.0-1nodesource.el7.centos 完了しました! [root@centos ~]#