node.js 셋팅(리눅스 ver)

2014. 4. 17. 18:12OpenSource/node.js

반응형



환경 : Linux 64bit


http://nodejs.org/download/

로 접속하시면 아래의 내용이 나옵니다. 상황에 맞게 다운로드를 받되 소스 코드를 받으세요~





Windows Installer (.msi)
32-bit64-bit
Windows Binary (.exe)32-bit64-bit
Mac OS X Installer (.pkg)Universal
Mac OS X Binaries (.tar.gz)32-bit64-bit
Linux Binaries (.tar.gz)32-bit64-bit
SunOS Binaries (.tar.gz)32-bit64-bit
Source Codenode-v0.10.26.tar.gz

Note: Python 2.6 or 2.7 is required to build from source tarballs.


위의 노트 에서와 같이 Python이 필요 합니다...

Index of /ftp/python/2.7.5/


../
Python-2.7.5.tar.bz2                               12-May-2013 03:46            12147710
Python-2.7.5.tar.bz2.asc                           12-May-2013 03:43                 198
Python-2.7.5.tar.xz                                12-May-2013 03:48            10252148
Python-2.7.5.tar.xz.asc                            12-May-2013 03:43                 198
Python-2.7.5.tgz                                   12-May-2013 03:51            14492759
Python-2.7.5.tgz.asc                               12-May-2013 03:43                 198
python-2.7.5-macosx10.3.dmg                        16-May-2013 01:48            20395084
python-2.7.5-macosx10.3.dmg.asc                    16-May-2013 02:00                 487
python-2.7.5-macosx10.6.dmg                        13-May-2013 20:24            19979778
python-2.7.5-macosx10.6.dmg.asc                    13-May-2013 20:47                 487
python-2.7.5-pdb.zip                               15-May-2013 20:54            18236482
python-2.7.5-pdb.zip.asc                           15-May-2013 20:57                 203
python-2.7.5.amd64-pdb.zip                         15-May-2013 20:56            17556546
python-2.7.5.amd64-pdb.zip.asc                     15-May-2013 20:58                 203
python-2.7.5.amd64.msi                             15-May-2013 20:56            16617472
python-2.7.5.amd64.msi.asc                         15-May-2013 20:58                 203
python-2.7.5.msi                                   15-May-2013 20:54            16228352
python-2.7.5.msi.asc                               15-May-2013 20:57                 203
python275.chm                                      15-May-2013 20:50             5997097
python275.chm.asc                                  23-Jul-2013 12:14                 203

<< PYTHON SETTING >>

 ./configure --prefix /home/nodejs/svc0/python


make


make test


--prefix /home/nodejs/svc0/python

python]$ ls

make instal

python]$ ls

bin  include  lib  share


<< NODE SETTING >>

python export

$ export PATH=/home/nodejs/svc0/python/bin:$PATH


 ./configure --prefix /home/nodejs/svc0/node.js

{ 'target_defaults': { 'cflags': [],

                       'default_configuration': 'Release',

                       'defines': [],

                       'include_dirs': [],

                       'libraries': []},

  'variables': { 'clang': 0,

                 'gcc_version': 41,

                 'host_arch': 'x64',

                 'node_install_npm': 'true',

                 'node_prefix': '/home/nodejs/svc0/node.js',

                 'node_shared_cares': 'false',

                 'node_shared_http_parser': 'false',

                 'node_shared_libuv': 'false',

                 'node_shared_openssl': 'false',

                 'node_shared_v8': 'false',

                 'node_shared_zlib': 'false',

                 'node_tag': '',

                 'node_unsafe_optimizations': 0,

                 'node_use_dtrace': 'false',

                 'node_use_etw': 'false',

                 'node_use_openssl': 'true',

                 'node_use_perfctr': 'false',

                 'node_use_systemtap': 'false',

                 'python': '/home/nodejs/svc0/python/bin/python',

                 'target_arch': 'x64',

                 'v8_enable_gdbjit': 0,

                 'v8_no_strict_aliasing': 1,

                 'v8_use_snapshot': 'true'}}

creating  ./config.gypi

creating  ./config.mk


$ make


$ maek test


<< error >>


=== release test-net-pingpong ===
Path: simple/test-net-pingpong
/home/nodejs/tools/node-v0.10.26/test/tmp/test.sock
server listening on /home/nodejs/tools/node-v0.10.26/test/tmp/test.sock undefined
server listening on 12346 undefined
events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: listen EAFNOSUPPORT
    at errnoException (net.js:904:11)
    at Server._listen2 (net.js:1023:19)
    at listen (net.js:1064:10)
    at net.js:1146:9
    at dns.js:72:18
    at process._tickCallback (node.js:415:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)

    at node.js:902:3



$ make install


 ./configure --prefix /home/nodejs/svc0/node.js

로 정해준 /home/nodejs/svc0/node.js에 가보면 아래와 같이 bin include lib share등이 

install되어진 것을 확인 할 수 있다.


node.js]$ ls

bin  include  lib  share


Python과 Node의 셋팅이 끝이 났다면...  .bash_profile의 PATH에 추가하여준다.

PATH=$PATH:$HOME/bin:/home/nodejs/svc0/python:/home/nodejs/svc0/node.js/bin

export PATH


적용하기 위해서는 . .bash_profile  or source .bash_profile 등이 되겠다.


아...자꾸 날아가서...ㅠㅠ

npm 버전은??

$npm -v

1.4.3


npm install buffer-writer

npm install date-utils

npm install error

npm install express

npm install forever -g

npm install jade

npm install socket.io


위의 형식으로..아래의 서브모듈들을 설치 하였다.


byline     easy-pipe  file       tail        uptime

commander  express    socket.io  underscore  winston


Module Dependency

각 모듈에 들어가보면..

ex) /home/nodejs/svc0/subModule/node_modules/socket.io

package.json 라는 파일이 있으며 이 파일에서 dependencies를 확인하여 보면 된다.


"dependencies": {

    "socket.io-client": "0.9.16",

    "policyfile": "0.0.4",

    "base64id": "0.1.0",

    "redis": "0.7.3"

  },








반응형