Ubuntu10.04 に node.js をインストールする

作業メモです。

まず、ソースをダウンロード。

$ wget http://nodejs.org/dist/v0.6.14/node-v0.6.14.tar.gz

解凍。

$ tar xzvf node-v0.6.14.tar.gz
$ cd node-v0.6.14

configure 。

$ ./configure
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 gcc                         : ok
Checking for library dl                  : yes
Checking for openssl                     : yes
Checking for library util                : yes
Checking for library rt                  : yes
Checking for fdatasync(2) with c++       : yes

私の環境では 最初 次のようにエラーが出たので libssl-dev をインストールしました。

Checking for openssl                     : not found
Checking for function SSL_library_init   : not found
Checking for header openssl/crypto.h     : not found
/home/odin/node-v0.6.14/wscript:374: error: Could not autodetect 
OpenSSL support. Make sure OpenSSL development packages are ...
$ apt-get install libssl-dev 

make と make install 。

$ make
$ sudo make install

node コマンドを実行してみます。

$ node
> 3 + 5
8
> var a = 3;
undefined
> console.log(a);
3
undefined

これで終わりです。

Google サイト内検索

Amazonアソシエイト