밑에 글도 있고 해서, 그냥 두려다 적어봅니다.
centos 5.x대에서 설치한 것이고요.
테스트시에는 돌아다니는 소스로 돌린것 같습니다.
설치시 그냥 참조만 하세요.
==========================================================
# ./configure
Checking for program g++ or c++ : not found
Checking for program icpc : not found
Checking for program c++ : not found
/home/demo_utf/html/node-v0.4.11/wscript:232: error: could not configure a cxx compiler!
# yum install gcc-c++.i386 <== 이거 설치하면 의존성 에러는 해결된다.
# ./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 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) : no
--- 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 : not found
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.517s)
# make
# make install
Waf: Entering directory `/home/demo_utf/html/node-v0.4.11/build'
DEST_OS: linux
DEST_CPU: ia32
Parallel Jobs: 1
Product type: program
* installing deps/libeio/eio.h as /usr/local/include/node/eio.h
* installing deps/v8/include/v8stdint.h as /usr/local/include/node/v8stdint.h
* installing deps/v8/include/v8.h as /usr/local/include/node/v8.h
* installing deps/v8/include/v8-preparser.h as /usr/local/include/node/v8-preparser.h
* installing deps/v8/include/v8-debug.h as /usr/local/include/node/v8-debug.h
* installing deps/v8/include/v8-profiler.h as /usr/local/include/node/v8-profiler.h
* installing deps/v8/include/v8-testing.h as /usr/local/include/node/v8-testing.h
* installing deps/libev/ev.h as /usr/local/include/node/ev.h
* installing build/default/config.h as /usr/local/include/node/config.h
* installing src/node.h as /usr/local/include/node/node.h
* installing src/node_object_wrap.h as /usr/local/include/node/node_object_wrap.h
* installing src/node_buffer.h as /usr/local/include/node/node_buffer.h
* installing src/node_events.h as /usr/local/include/node/node_events.h
* installing src/node_version.h as /usr/local/include/node/node_version.h
* installing doc/node.1 as /usr/local/share/man/man1/node.1
* installing tools/node-waf as /usr/local/bin/node-waf
* installing tools/wafadmin/Configure.py as /usr/local/lib/node/wafadmin/Configure.py
* installing tools/wafadmin/ansiterm.py as /usr/local/lib/node/wafadmin/ansiterm.py
* installing tools/wafadmin/Build.py as /usr/local/lib/node/wafadmin/Build.py
* installing tools/wafadmin/Constants.py as /usr/local/lib/node/wafadmin/Constants.py
* installing tools/wafadmin/Logs.py as /usr/local/lib/node/wafadmin/Logs.py
* installing tools/wafadmin/Runner.py as /usr/local/lib/node/wafadmin/Runner.py
* installing tools/wafadmin/Node.py as /usr/local/lib/node/wafadmin/Node.py
* installing tools/wafadmin/py3kfixes.py as /usr/local/lib/node/wafadmin/py3kfixes.py
* installing tools/wafadmin/Task.py as /usr/local/lib/node/wafadmin/Task.py
* installing tools/wafadmin/__init__.py as /usr/local/lib/node/wafadmin/__init__.py
* installing tools/wafadmin/pproc.py as /usr/local/lib/node/wafadmin/pproc.py
* installing tools/wafadmin/TaskGen.py as /usr/local/lib/node/wafadmin/TaskGen.py
* installing tools/wafadmin/Utils.py as /usr/local/lib/node/wafadmin/Utils.py
* installing tools/wafadmin/Options.py as /usr/local/lib/node/wafadmin/Options.py
* installing tools/wafadmin/scripting.py as /usr/local/lib/node/wafadmin/scripting.py
* installing tools/wafadmin/Environment.py as /usr/local/lib/node/wafadmin/Environment.py
* installing tools/wafadmin/Tools/xlcxx.py as /usr/local/lib/node/wafadmin/Tools/xlcxx.py
* installing tools/wafadmin/Tools/dmd.py as /usr/local/lib/node/wafadmin/Tools/dmd.py
* installing tools/wafadmin/Tools/gas.py as /usr/local/lib/node/wafadmin/Tools/gas.py
* installing tools/wafadmin/Tools/python.py as /usr/local/lib/node/wafadmin/Tools/python.py
* installing tools/wafadmin/Tools/d.py as /usr/local/lib/node/wafadmin/Tools/d.py
* installing tools/wafadmin/Tools/gxx.py as /usr/local/lib/node/wafadmin/Tools/gxx.py
* installing tools/wafadmin/Tools/preproc.py as /usr/local/lib/node/wafadmin/Tools/preproc.py
* installing tools/wafadmin/Tools/gcc.py as /usr/local/lib/node/wafadmin/Tools/gcc.py
* installing tools/wafadmin/Tools/gob2.py as /usr/local/lib/node/wafadmin/Tools/gob2.py
* installing tools/wafadmin/Tools/config_c.py as /usr/local/lib/node/wafadmin/Tools/config_c.py
* installing tools/wafadmin/Tools/osx.py as /usr/local/lib/node/wafadmin/Tools/osx.py
* installing tools/wafadmin/Tools/ccroot.py as /usr/local/lib/node/wafadmin/Tools/ccroot.py
* installing tools/wafadmin/Tools/icc.py as /usr/local/lib/node/wafadmin/Tools/icc.py
* installing tools/wafadmin/Tools/winres.py as /usr/local/lib/node/wafadmin/Tools/winres.py
* installing tools/wafadmin/Tools/gnu_dirs.py as /usr/local/lib/node/wafadmin/Tools/gnu_dirs.py
* installing tools/wafadmin/Tools/xlc.py as /usr/local/lib/node/wafadmin/Tools/xlc.py
* installing tools/wafadmin/Tools/icpc.py as /usr/local/lib/node/wafadmin/Tools/icpc.py
* installing tools/wafadmin/Tools/intltool.py as /usr/local/lib/node/wafadmin/Tools/intltool.py
* installing tools/wafadmin/Tools/cxx.py as /usr/local/lib/node/wafadmin/Tools/cxx.py
* installing tools/wafadmin/Tools/misc.py as /usr/local/lib/node/wafadmin/Tools/misc.py
* installing tools/wafadmin/Tools/nasm.py as /usr/local/lib/node/wafadmin/Tools/nasm.py
* installing tools/wafadmin/Tools/__init__.py as /usr/local/lib/node/wafadmin/Tools/__init__.py
* installing tools/wafadmin/Tools/suncxx.py as /usr/local/lib/node/wafadmin/Tools/suncxx.py
* installing tools/wafadmin/Tools/compiler_d.py as /usr/local/lib/node/wafadmin/Tools/compiler_d.py
* installing tools/wafadmin/Tools/ar.py as /usr/local/lib/node/wafadmin/Tools/ar.py
* installing tools/wafadmin/Tools/suncc.py as /usr/local/lib/node/wafadmin/Tools/suncc.py
* installing tools/wafadmin/Tools/node_addon.py as /usr/local/lib/node/wafadmin/Tools/node_addon.py
* installing tools/wafadmin/Tools/unittestw.py as /usr/local/lib/node/wafadmin/Tools/unittestw.py
* installing tools/wafadmin/Tools/compiler_cc.py as /usr/local/lib/node/wafadmin/Tools/compiler_cc.py
* installing tools/wafadmin/Tools/compiler_cxx.py as /usr/local/lib/node/wafadmin/Tools/compiler_cxx.py
* installing tools/wafadmin/Tools/gdc.py as /usr/local/lib/node/wafadmin/Tools/gdc.py
* installing tools/wafadmin/Tools/cc.py as /usr/local/lib/node/wafadmin/Tools/cc.py
* installing tools/wafadmin/Tools/libtool.py as /usr/local/lib/node/wafadmin/Tools/libtool.py
* installing build/default/tools/nodejs.pc as /usr/local/lib/pkgconfig/nodejs.pc
* installing build/default/node as /usr/local/bin/node
* installing build/default/src/node_config.h as /usr/local/include/node/node_config.h
Waf: Leaving directory `/home/demo_utf/html/node-v0.4.11/build'
'install' finished successfully (0.361s)
# whereis node
node: /usr/local/bin/node /usr/local/lib/node
# vi helloworld.js
// helloworld1.js
var sys = require("sys")
setTimeout(function() {
sys.puts("world");
}, 2000);
sys.puts("hello");
# node helloworld.js
hello
world
# vi helloworld2.js
puts = require("sys").puts;
setInterval(function() {
puts("hello");
}, 500);
process.addListener("SIGINT", function() {
puts("good-bye");
process.exit(0);
});
# node helloworld2.js
hello
hello
hello
hello
hello
hello
.......
500개가 찍히게 된다.
TCP 서버 구현
# vi tcp_test.js
var tcp = require("net");
var s = tcp.createServer();
s.addListener("connection", function(c) {
c.write("hello!");
c.end();
});
s.listen(8000);
8000 포트에서 대기상태로 있게 된다.
# node tcp_test.js
그리고 브라우저에서 http://localhost:8000/ 로 접속하면 hello가 찍히게 된다.
댓글 1개
14년 전
최신버전은 2011.12.04일자 v0.6.5 이네요.
설치법은 동일.
설치법은 동일.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 4030 | 14년 전 | 2110 | ||
| 4029 |
|
14년 전 | 705 | |
| 4028 | 14년 전 | 3618 | ||
| 4027 | 14년 전 | 3747 | ||
| 4026 |
techer
|
14년 전 | 1123 | |
| 4025 |
techer
|
14년 전 | 685 | |
| 4024 | 14년 전 | 1359 | ||
| 4023 | 14년 전 | 602 | ||
| 4022 | 14년 전 | 923 | ||
| 4021 | 14년 전 | 513 | ||
| 4020 | 14년 전 | 7338 | ||
| 4019 | 14년 전 | 1027 | ||
| 4018 | 14년 전 | 444 | ||
| 4017 | 14년 전 | 599 | ||
| 4016 | 14년 전 | 1303 | ||
| 4015 | 14년 전 | 734 | ||
| 4014 | 14년 전 | 566 | ||
| 4013 | 14년 전 | 688 | ||
| 4012 | 14년 전 | 617 | ||
| 4011 |
브라운벤취
|
14년 전 | 426 | |
| 4010 |
크라잉감튀
|
14년 전 | 593 | |
| 4009 | 14년 전 | 574 | ||
| 4008 | 14년 전 | 563 | ||
| 4007 | 14년 전 | 639 | ||
| 4006 |
네비플러스
|
14년 전 | 880 | |
| 4005 | 14년 전 | 895 | ||
| 4004 | 14년 전 | 1118 | ||
| 4003 | 14년 전 | 779 | ||
| 4002 |
핑크스파이더
|
14년 전 | 699 | |
| 4001 | 14년 전 | 578 | ||
| 4000 |
BYongLuv
|
14년 전 | 546 | |
| 3999 |
xxbobo
|
14년 전 | 530 | |
| 3998 | 14년 전 | 715 | ||
| 3997 | 14년 전 | 1930 | ||
| 3996 | 14년 전 | 582 | ||
| 3995 | 14년 전 | 908 | ||
| 3994 |
asdfdasfddd
|
14년 전 | 2078 | |
| 3993 | 14년 전 | 1181 | ||
| 3992 | 14년 전 | 953 | ||
| 3991 | 14년 전 | 4689 | ||
| 3990 |
Torrious
|
14년 전 | 1898 | |
| 3989 | 14년 전 | 765 | ||
| 3988 |
내꿈은대통령
|
14년 전 | 638 | |
| 3987 | 14년 전 | 617 | ||
| 3986 |
|
14년 전 | 472 | |
| 3985 | 14년 전 | 1738 | ||
| 3984 | 14년 전 | 3059 | ||
| 3983 | 14년 전 | 553 | ||
| 3982 | 14년 전 | 749 | ||
| 3981 | 14년 전 | 1733 | ||
| 3980 | 14년 전 | 601 | ||
| 3979 |
AMDbest
|
14년 전 | 1252 | |
| 3978 |
leadK
|
14년 전 | 1600 | |
| 3977 |
좋은천사7
|
14년 전 | 10383 | |
| 3976 |
좋은천사7
|
14년 전 | 1128 | |
| 3975 |
좋은천사7
|
14년 전 | 940 | |
| 3974 |
좋은천사7
|
14년 전 | 1659 | |
| 3973 |
좋은천사7
|
14년 전 | 1694 | |
| 3972 |
좋은천사7
|
14년 전 | 869 | |
| 3971 |
김준수사랑
|
14년 전 | 971 | |
| 3970 |
레인보우1492
|
14년 전 | 788 | |
| 3969 | 14년 전 | 2420 | ||
| 3968 | 14년 전 | 583 | ||
| 3967 | 14년 전 | 728 | ||
| 3966 | 14년 전 | 1784 | ||
| 3965 | 14년 전 | 2069 | ||
| 3964 |
방황하는중년
|
14년 전 | 515 | |
| 3963 |
네비플러스
|
14년 전 | 894 | |
| 3962 | 14년 전 | 679 | ||
| 3961 | 14년 전 | 733 | ||
| 3960 | 14년 전 | 929 | ||
| 3959 | 14년 전 | 740 | ||
| 3958 |
techer
|
14년 전 | 650 | |
| 3957 |
techer
|
14년 전 | 467 | |
| 3956 |
techer
|
14년 전 | 441 | |
| 3955 |
techer
|
14년 전 | 670 | |
| 3954 |
8제임스8
|
14년 전 | 824 | |
| 3953 |
구름1354
|
14년 전 | 646 | |
| 3952 |
8제임스8
|
14년 전 | 617 | |
| 3951 | 14년 전 | 2436 | ||
| 3950 | 14년 전 | 955 | ||
| 3949 | 14년 전 | 1101 | ||
| 3948 | 14년 전 | 1076 | ||
| 3947 | 14년 전 | 1511 | ||
| 3946 |
|
14년 전 | 1899 | |
| 3945 | 14년 전 | 596 | ||
| 3944 |
|
14년 전 | 778 | |
| 3943 | 14년 전 | 1812 | ||
| 3942 | 14년 전 | 800 | ||
| 3941 | 14년 전 | 2099 | ||
| 3940 |
내일은없다
|
14년 전 | 586 | |
| 3939 | 14년 전 | 786 | ||
| 3938 | 14년 전 | 894 | ||
| 3937 | 14년 전 | 2010 | ||
| 3936 | 14년 전 | 832 | ||
| 3935 | 14년 전 | 3199 | ||
| 3934 | 14년 전 | 965 | ||
| 3933 | 14년 전 | 497 | ||
| 3932 | 14년 전 | 827 | ||
| 3931 |
Jos87
|
14년 전 | 674 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기