LoginSignup
1
1

More than 5 years have passed since last update.

CentOS7.2にNode.js環境を構築する

Posted at

CentOSにNode.jsをインストールする

インストールとバージョン確認

[root@Alnilam ~]$ yum install nodejs --enablerepo=epel
[root@Alnilam ~]$ node -v
v0.10.42

非常に簡単ですが、バージョンが凄く古いようです。
公式からソースコード取得の上、ビルドします。

2016年4月8日時点の安定版は、以下のようです
nodejs.png

コンパイラのインストールとビルド

[root@Alnilam ~]$ yum install wget
[root@Alnilam ~]$ yum install gcc-c++
[root@Alnilam ~]$ wget https://nodejs.org/dist/v4.4.2/node-v4.4.2.tar.gz
[root@Alnilam ~]$ tar -zxvf node-v4.4.2.tar.gz 
[root@Alnilam ~]$ cd node-v4.4.2
[root@Alnilam node-v4.4.2]$ ./configure
[root@Alnilam node-v4.4.2]$ make
#・・・30分ほど待つ
[root@Alnilam node-v4.4.2]$ make install
[root@Alnilam node-v4.4.2]$ /usr/local/bin/node -v
v4.4.2

インストールできました。今後はExpressを利用してAPIなど構築したいと存じます。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1