2011年8月20日土曜日

node.jsインストール

もろもろバージョンが上がって来たので、今日はnodeのインストールを再構築してみます。
v4.11で進めます。

環境はW5に入れている、debian squeezeです。
Linux debian 2.6.32-5-686 #1 SMP Mon Jun 13 04:13:06 UTC 2011 i686 GNU/Linux
日本語解説サイトはもはや役に立たないので公式情報を参考に進めていきます
特にsidしかパッケージがないこともあり自前でbuildする必要があります。/usr以下を汚したくないため$HOME/localにインストール方法なので後で後くされなく消せるのでおすすめな方法です。


まずは、gitから落としてきます
shin@debian:~/dev$ git clone --depth 1 git://github.com/joyent/node.git
Cloning into node...
remote: Counting objects: 21010, done.
remote: Compressing objects: 100% (8487/8487), done.
remote: Total 21010 (delta 16287), reused 16130 (delta 12136)
Receiving objects: 100% (21010/21010), 32.83 MiB | 263 KiB/s, done.
Resolving deltas: 100% (16287/16287), done.

つぎにv4.11 をcheck outします


shin@debian:~/dev$ cd node/
shin@debian:~/dev/node$ git checkout v0.4.11
Note: checking out 'v0.4.11'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at a745d19... Bump version to v0.4.11

$HOME/local/nodeへのインストールを指示しconfigureします。


shin@debian:~/dev/node$ export JOBS=2
shin@debian:~/dev/node$ mkdir ~/local
shin@debian:~/dev/node$ ./configure --prefix=$HOME/local/node
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for program gcc or cc           : /usr/bin/gcc 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for gcc                         : ok  
Checking for library dl                  : yes 
Checking for openssl                     : yes 
Checking for library util                : yes 
Checking for library rt                  : yes 
--- libeio ---
Checking for library pthread             : yes 
Checking for function pthread_create     : yes 
Checking for function pthread_atfork     : yes 
Checking for futimes(2)                  : yes 
Checking for readahead(2)                : yes 
Checking for fdatasync(2)                : yes 
Checking for pread(2) and pwrite(2)      : yes 
Checking for sendfile(2)                 : yes 
Checking for sync_file_range(2)          : yes 
--- libev ---
Checking for header sys/inotify.h        : yes 
Checking for function inotify_init       : yes 
Checking for header sys/epoll.h          : yes 
Checking for function epoll_ctl          : yes 
Checking for header port.h               : not found 
Checking for header poll.h               : yes 
Checking for function poll               : yes 
Checking for header ['sys/types.h', 'sys/event.h'] : not found 
Checking for header sys/queue.h                    : yes 
Checking for function kqueue                       : not found 
Checking for header sys/select.h                   : yes 
Checking for function select                       : yes 
Checking for header sys/eventfd.h                  : yes 
Checking for function eventfd                      : yes 
Checking for SYS_clock_gettime                     : yes 
Checking for library rt                            : yes 
Checking for function clock_gettime                : yes 
Checking for function nanosleep                    : yes 
Checking for function ceil                         : yes 
Checking for fdatasync(2) with c++                 : yes 
'configure' finished successfully (4.283s)

 あとは、まけまけインストール

shin@debian:~/dev/node$ make
shin@debian:~/dev/node$ make install

最後に.profileにPATHを設定します

shin@debian:~$ echo 'export PATH=$HOME/local/node/bin:$PATH' >> ~/.profile
shin@debian:~$ echo 'export NODE_PATH=$HOME/local/node:$HOME/local/node/lib/node_modules' >> ~/.profile
shin@debian:~$ source ~/.profile

インストールはこれで終わりです

0 件のコメント:

コメントを投稿