1. 설치


node.js를 설치합니다.

오늘 기준으로 v6.11.0 (includes npm 3.10.10) 버전을 설치하겠습니다.

https://nodejs.org/dist/v6.11.0/node-v6.11.0.tar.gz

설치 과정은 Node.js v0.12.4 Source Code Installation (http://sarc.io/index.php/miscellaneous/312) 문서를 참조하세요.

$ ./configure --prefix=/app/node/6.11.0

WARNING: failed to autodetect C++ compiler version (CXX=g++)
WARNING: failed to autodetect C compiler version (CC=gcc)
Node.js configure error: No acceptable C compiler found!

        Please make sure you have a C compiler installed on your system and/or
        consider adjusting the CC environment variable if you installed
        it in a non-standard prefix.

컴파일러 설치가 되어 있지 않은 것 같습니다.

$ yum install gcc-c++

다시 configure를 실행합니다.

$ ./configure --prefix=/app/node/6.11.0
WARNING: C++ compiler too old, need g++ 4.8 or clang++ 3.4 (CXX=g++)
creating ./icu_config.gypi
* Using ICU in deps/icu-small
Using version-specific floating patch tools/icu/patches/58/source/i18n/digitlst.cpp
creating ./icu_config.gypi
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'asan': 0,
                 'coverage': 'false',
                 'debug_devtools': 'node',
                 'force_dynamic_crt': 0,
                 'gas_version': '2.20',
                 'host_arch': 'x64',
                 'icu_data_file': 'icudt58l.dat',
                 'icu_data_in': '../../deps/icu-small/source/data/in/icudt58l.dat',
                 'icu_endianness': 'l',
                 'icu_gyp_path': 'tools/icu/icu-generic.gyp',
                 'icu_locales': 'en,root',
                 'icu_path': 'deps/icu-small',
                 'icu_small': 'true',
                 'icu_ver_major': '58',
                 'node_byteorder': 'little',
                 'node_enable_d8': 'false',
                 'node_enable_v8_vtunejit': 'false',
                 'node_install_npm': 'true',
                 'node_module_version': 48,
                 'node_no_browser_globals': 'false',
                 'node_prefix': '/app/node/6.11.0',
                 'node_release_urlbase': '',
                 'node_shared': 'false',
                 'node_shared_cares': 'false',
                 'node_shared_http_parser': 'false',
                 'node_shared_libuv': 'false',
                 'node_shared_openssl': 'false',
                 'node_shared_zlib': 'false',
                 'node_tag': '',
                 'node_use_bundled_v8': 'true',
                 'node_use_dtrace': 'false',
                 'node_use_etw': 'false',
                 'node_use_lttng': 'false',
                 'node_use_openssl': 'true',
                 'node_use_perfctr': 'false',
                 'node_use_v8_platform': 'true',
                 'openssl_fips': '',
                 'openssl_no_asm': 0,
                 'shlib_suffix': 'so.48',
                 'target_arch': 'x64',
                 'uv_parent_path': '/deps/uv/',
                 'uv_use_dtrace': 'false',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 1,
                 'v8_inspector': 'true',
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 0,
                 'v8_random_seed': 0,
                 'v8_use_snapshot': 'true',
                 'want_separate_host_toolset': 0}}
creating ./config.gypi
creating ./config.mk
WARNING: warnings were emitted in the configure phase

워닝이 발생했지만 계속 진행해보기로 합니다. make 실행합니다.

make

../deps/v8/src/base/platform/mutex.h:211: error: expected declaration before ‘}’ token
make[1]: *** [/app/nodejs/installer/node-v6.11.0/out/Release/obj.target/v8_libplatform/deps/v8/src/libplatform/default-platform.o] Error 1
make[1]: Leaving directory `/app/nodejs/installer/node-v6.11.0/out'
make: *** [node] Error 2

역시 configure에서 발생한 오류가 찜찜합니다. 그런데 눈을 크게 뜨고 찾아보니..

WARNING: C++ compiler too old, need g++ 4.8 or clang++ 3.4 (CXX=g++)

g++ 버전 문제인 것 같습니다. 이것부터 해결해야 합니다. 

 

 

2. 기타


위 해결책은 별도 문서로 분리합니다. 

C++ (g++) 높은 버전 설치하기 (yum) 

http://sarc.io/index.php/miscellaneous/771

 

그리고 configure, make, make install 설치에 성공하였다는 희소식으로 마무리합니다.