LoginSignup
100
93

More than 5 years have passed since last update.

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

Posted at

毎度、インストール方法を忘れてしまうので、いくつかのパターンとしてメモしておきます。

RPMから

公式には配布されていないので、EPELリポジトリからインストールします。

$ sudo yum install epel-release
$ sudo yum install nodejs
$ node -v
v0.10.32

ソースから

ソースからビルドします。開発ツールが入ってない場合は、一括でインストールする。

$ sudo yum groupinstall 'Development tools'
$ curl -O http://nodejs.org/dist/v0.10.32/node-v0.10.32.tar.gz 
$ tar xvf node-v0.10.32.tar.gz
$ cd node-v0.10.32/
$ ./configure --prefix=/usr/local
$ make
$ sudo make install

で、/usr/local/ に入るでしょう。

バイナリから

一応、本家からバイナリも配布されています。まれだとは思いますが、ここからインストールも出来ます。

$ curl -O http://nodejs.org/dist/v0.10.32/node-v0.10.32-linux-x64.tar.gz
$ sudo tar --strip-components 1 -xzvf node-v0.10.32-linux-x64.tar.gz -C /usr/local

第1階層のフォルダをすっ飛ばして、/usr/local にぶち込みます。

以上

100
93
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
100
93