我跟着这个答案在 CentOS 6 上安装 NodeJS。当我到达步骤 8 并输入时make
,出现以下错误。
指示:
su -
yum install gcc-c++ openssl-devel
cd /usr/local/src
wget http://nodejs.org/dist/node-latest.tar.gz
tar zxvf node-latest.tar.gz
(cd into extracted folder: ex "cd node-v0.10.3")
./configure
#step 8
make
make install
错误:
make -C out BUILDTYPE=Release V=1
make[1]: Entering directory `/usr/local/src/node-v9.7.1/out'
LD_LIBRARY_PATH=/usr/local/src/node-v9.7.1/out/Release/lib.host:/usr/local/src/node-v9.7.1/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../.; mkdir -p /usr/local/src/node-v9.7.1/out/Release/obj/gen; python tools/js2c.py "/usr/local/src/node-v9.7.1/out/Release/obj/gen/node_javascript.cc" lib/internal/bootstrap_node.js lib/async_hooks.js lib/assert.js lib/buffer.js lib/child_process.js lib/console.js lib/constants.js lib/crypto.js lib/cluster.js lib/dgram.js lib/dns.js lib/domain.js lib/events.js lib/fs.js lib/http.js lib/http2.js lib/_http_agent.js lib/_http_client.js lib/_http_common.js lib/_http_incoming.js lib/_http_outgoing.js lib/_http_server.js lib/https.js lib/inspector.js lib/module.js lib/net.js lib/os.js lib/path.js lib/perf_hooks.js lib/process.js lib/punycode.js lib/querystring.js lib/readline.js lib/repl.js lib/stream.js lib/_stream_readable.js lib/_stream_writable.js lib/_stream_duplex.js lib/_stream_transform.js lib/_stream_passthrough.js lib/_stream_wrap.js lib/string_decoder.js lib/sys.js lib/timers.js lib/tls.js lib/_tls_common.js lib/_tls_legacy.js lib/_tls_wrap.js lib/tty.js lib/url.js lib/util.js lib/v8.js lib/vm.js lib/zlib.js lib/internal/async_hooks.js lib/internal/buffer.js lib/internal/child_process.js lib/internal/cluster/child.js lib/internal/cluster/master.js lib/internal/cluster/round_robin_handle.js lib/internal/cluster/shared_handle.js lib/internal/cluster/utils.js lib/internal/cluster/worker.js lib/internal/crypto/certificate.js lib/internal/crypto/cipher.js lib/internal/crypto/diffiehellman.js lib/internal/crypto/hash.js lib/internal/crypto/pbkdf2.js lib/internal/crypto/random.js lib/internal/crypto/sig.js lib/internal/crypto/util.js lib/internal/constants.js lib/internal/encoding.js lib/internal/errors.js lib/internal/freelist.js lib/internal/fs.js lib/internal/http.js lib/internal/inspector_async_hook.js lib/internal/linkedlist.js lib/internal/loader/Loader.js lib/internal/loader/CreateDynamicModule.js lib/internal/loader/DefaultResolve.js lib/internal/loader/ModuleJob.js lib/internal/loader/ModuleMap.js lib/internal/loader/ModuleWrap.js lib/internal/loader/Translators.js lib/internal/safe_globals.js lib/internal/net.js lib/internal/module.js lib/internal/os.js lib/internal/process/next_tick.js lib/internal/process/promises.js lib/internal/process/stdio.js lib/internal/process/warning.js lib/internal/process.js lib/internal/querystring.js lib/internal/process/write-coverage.js lib/internal/readline.js lib/internal/repl.js lib/internal/socket_list.js lib/internal/test/unicode.js lib/internal/tls.js lib/internal/trace_events_async_hooks.js lib/internal/url.js lib/internal/util.js lib/internal/util/comparisons.js lib/internal/util/inspector.js lib/internal/util/types.js lib/internal/http2/core.js lib/internal/http2/compat.js lib/internal/http2/util.js lib/internal/v8_prof_polyfill.js lib/internal/v8_prof_processor.js lib/internal/vm/Module.js lib/internal/streams/lazy_transform.js lib/internal/streams/BufferList.js lib/internal/streams/legacy.js lib/internal/streams/destroy.js lib/internal/wrap_js_stream.js deps/v8/tools/splaytree.js deps/v8/tools/codemap.js deps/v8/tools/consarray.js deps/v8/tools/csvparser.js deps/v8/tools/profile.js deps/v8/tools/profile_view.js deps/v8/tools/logreader.js deps/v8/tools/tickprocessor.js deps/v8/tools/SourceMap.js deps/v8/tools/tickprocessor-driver.js deps/node-inspect/lib/_inspect.js deps/node-inspect/lib/internal/inspect_client.js deps/node-inspect/lib/internal/inspect_repl.js ./config.gypi src/notrace_macros.py src/nolttng_macros.py src/noperfctr_macros.py
touch a5c278cd213bbd4cab873a29634fa71da95829b2.intermediate
LD_LIBRARY_PATH=/usr/local/src/node-v9.7.1/out/Release/lib.host:/usr/local/src/node-v9.7.1/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/src/inspector; mkdir -p /usr/local/src/node-v9.7.1/out/Release/obj/gen/src/inspector/protocol /usr/local/src/node-v9.7.1/out/Release/obj/gen/include/inspector; python ../../third_party/inspector_protocol/CodeGenerator.py --jinja_dir ../../third_party --output_base "/usr/local/src/node-v9.7.1/out/Release/obj/gen/src/inspector" --config inspector_protocol_config.json
g++ '-DU_COMMON_IMPLEMENTATION=1' '-DU_ATTRIBUTE_DEPRECATED=' '-D_CRT_SECURE_NO_DEPRECATE=' '-DU_STATIC_IMPLEMENTATION=1' '-DUCONFIG_NO_SERVICE=1' '-DUCONFIG_NO_REGULAR_EXPRESSIONS=1' '-DU_ENABLE_DYLOAD=0' '-DU_HAVE_STD_STRING=0' '-DUCONFIG_NO_BREAK_ITERATION=0' -I../deps/icu-small/source/common -pthread -Wall -Wextra -Wno-unused-parameter -m64 -Wno-deprecated-declarations -O3 -fno-omit-frame-pointer -fno-exceptions -std=gnu++0x -frtti -MMD -MF /usr/local/src/node-v9.7.1/out/Release/.deps//usr/local/src/node-v9.7.1/out/Release/obj.target/icuucx/deps/icu-small/source/common/ures_cnv.o.d.raw -c -o /usr/local/src/node-v9.7.1/out/Release/obj.target/icuucx/deps/icu-small/source/common/ures_cnv.o ../deps/icu-small/source/common/ures_cnv.cpp
In file included from ../deps/icu-small/source/common/unicode/unistr.h:33,
from ../deps/icu-small/source/common/unicode/ures.h:794,
from ../deps/icu-small/source/common/ures_cnv.cpp:25:
../deps/icu-small/source/common/unicode/char16ptr.h:69: error: expected ‘)’ before ‘p’
../deps/icu-small/source/common/unicode/char16ptr.h:117: error: expected ‘)’ before ‘p’
../deps/icu-small/source/common/unicode/char16ptr.h:176: error: expected unqualified-id before ‘p’
../deps/icu-small/source/common/unicode/char16ptr.h:176: error: expected ‘)’ before ‘p’
../deps/icu-small/source/common/unicode/char16ptr.h:176: error: expected ‘;’ before ‘p’
../deps/icu-small/source/common/unicode/char16ptr.h:225: error: expected unqualified-id before ‘p’
../deps/icu-small/source/common/unicode/char16ptr.h:225: error: expected ‘)’ before ‘p’
../deps/icu-small/source/common/unicode/char16ptr.h:225: error: expected initializer before ‘p’
In file included from ../deps/icu-small/source/common/unicode/ures.h:794,
from ../deps/icu-small/source/common/ures_cnv.cpp:25:
../deps/icu-small/source/common/unicode/unistr.h:3051: error: expected unqualified-id before ‘text’
../deps/icu-small/source/common/unicode/unistr.h:3051: error: expected ‘)’ before ‘text’
../deps/icu-small/source/common/unicode/unistr.h:3051: error: expected ‘;’ before ‘text’
../deps/icu-small/source/common/unicode/unistr.h:3107: error: expected unqualified-id before ‘text’
../deps/icu-small/source/common/unicode/unistr.h:3107: error: expected ‘)’ before ‘text’
../deps/icu-small/source/common/unicode/unistr.h:3107: error: expected ‘;’ before ‘text’
../deps/icu-small/source/common/unicode/unistr.h:3202: error: expected ‘)’ before ‘buffer’
../deps/icu-small/source/common/unicode/unistr.h: In constructor ‘icu_60::UnicodeString::UnicodeString(const uint16_t*)’:
../deps/icu-small/source/common/unicode/unistr.h:3014: error: type ‘icu_60::UnicodeString’ is not a direct base of ‘icu_60::UnicodeString’
../deps/icu-small/source/common/unicode/unistr.h: In constructor ‘icu_60::UnicodeString::UnicodeString(const uint16_t*, int32_t)’:
../deps/icu-small/source/common/unicode/unistr.h:3076: error: type ‘icu_60::UnicodeString’ is not a direct base of ‘icu_60::UnicodeString’
../deps/icu-small/source/common/unicode/unistr.h: In constructor ‘icu_60::UnicodeString::UnicodeString(uint16_t*, int32_t, int32_t)’:
../deps/icu-small/source/common/unicode/unistr.h:3169: error: type ‘icu_60::UnicodeString’ is not a direct base of ‘icu_60::UnicodeString’
../deps/icu-small/source/common/unicode/unistr.h: At global scope:
../deps/icu-small/source/common/unicode/unistr.h:3914: error: expected unqualified-id before ‘)’ token
../deps/icu-small/source/common/unicode/unistr.h:3914: error: prototype for ‘icu_60::UnicodeString::UnicodeString(...)’ does not match any in class ‘icu_60::UnicodeString’
../deps/icu-small/source/common/unicode/unistr.h:3375: error: candidates are: icu_60::UnicodeString::UnicodeString(const icu_60::UnicodeString&, int32_t, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3366: error: icu_60::UnicodeString::UnicodeString(const icu_60::UnicodeString&, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3358: error: icu_60::UnicodeString::UnicodeString(icu_60::UnicodeString&&)
../deps/icu-small/source/common/unicode/unistr.h:3350: error: icu_60::UnicodeString::UnicodeString(const icu_60::UnicodeString&)
../deps/icu-small/source/common/unicode/unistr.h:3331: error: icu_60::UnicodeString::UnicodeString(const char*, int32_t, icu_60::UnicodeString::EInvariant)
../deps/icu-small/source/common/unicode/unistr.h:3300: error: icu_60::UnicodeString::UnicodeString(const char*, int32_t, UConverter*, UErrorCode&)
../deps/icu-small/source/common/unicode/unistr.h:3277: error: icu_60::UnicodeString::UnicodeString(const char*, int32_t, const char*)
../deps/icu-small/source/common/unicode/unistr.h:3258: error: icu_60::UnicodeString::UnicodeString(const char*, const char*)
../deps/icu-small/source/common/unicode/unistr.h:3235: error: icu_60::UnicodeString::UnicodeString(const char*, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3225: error: icu_60::UnicodeString::UnicodeString(const char*)
../deps/icu-small/source/common/unicode/unistr.h:3168: error: icu_60::UnicodeString::UnicodeString(uint16_t*, int32_t, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3153: error: icu_60::UnicodeString::UnicodeString(char16_t*, int32_t, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3131: error: icu_60::UnicodeString::UnicodeString(UBool, icu_60::ConstChar16Ptr, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3075: error: icu_60::UnicodeString::UnicodeString(const uint16_t*, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3060: error: icu_60::UnicodeString::UnicodeString(const char16_t*, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3013: error: icu_60::UnicodeString::UnicodeString(const uint16_t*)
../deps/icu-small/source/common/unicode/unistr.h:2996: error: icu_60::UnicodeString::UnicodeString(const char16_t*)
../deps/icu-small/source/common/unicode/unistr.h:2984: error: icu_60::UnicodeString::UnicodeString(UChar32)
../deps/icu-small/source/common/unicode/unistr.h:2973: error: icu_60::UnicodeString::UnicodeString(char16_t)
../deps/icu-small/source/common/unicode/unistr.h:2962: error: icu_60::UnicodeString::UnicodeString(int32_t, UChar32, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3910: error: icu_60::UnicodeString::UnicodeString()
../deps/icu-small/source/common/unicode/unistr.h:3918: error: expected unqualified-id before ‘,’ token
../deps/icu-small/source/common/unicode/unistr.h:3918: error: expected ‘)’ before ‘,’ token
../deps/icu-small/source/common/unicode/unistr.h:3918: error: prototype for ‘icu_60::UnicodeString::UnicodeString(...)’ does not match any in class ‘icu_60::UnicodeString’
../deps/icu-small/source/common/unicode/unistr.h:3375: error: candidates are: icu_60::UnicodeString::UnicodeString(const icu_60::UnicodeString&, int32_t, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3366: error: icu_60::UnicodeString::UnicodeString(const icu_60::UnicodeString&, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3358: error: icu_60::UnicodeString::UnicodeString(icu_60::UnicodeString&&)
../deps/icu-small/source/common/unicode/unistr.h:3350: error: icu_60::UnicodeString::UnicodeString(const icu_60::UnicodeString&)
../deps/icu-small/source/common/unicode/unistr.h:3331: error: icu_60::UnicodeString::UnicodeString(const char*, int32_t, icu_60::UnicodeString::EInvariant)
../deps/icu-small/source/common/unicode/unistr.h:3300: error: icu_60::UnicodeString::UnicodeString(const char*, int32_t, UConverter*, UErrorCode&)
../deps/icu-small/source/common/unicode/unistr.h:3277: error: icu_60::UnicodeString::UnicodeString(const char*, int32_t, const char*)
../deps/icu-small/source/common/unicode/unistr.h:3258: error: icu_60::UnicodeString::UnicodeString(const char*, const char*)
../deps/icu-small/source/common/unicode/unistr.h:3235: error: icu_60::UnicodeString::UnicodeString(const char*, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3225: error: icu_60::UnicodeString::UnicodeString(const char*)
../deps/icu-small/source/common/unicode/unistr.h:3168: error: icu_60::UnicodeString::UnicodeString(uint16_t*, int32_t, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3153: error: icu_60::UnicodeString::UnicodeString(char16_t*, int32_t, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3131: error: icu_60::UnicodeString::UnicodeString(UBool, icu_60::ConstChar16Ptr, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3075: error: icu_60::UnicodeString::UnicodeString(const uint16_t*, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3060: error: icu_60::UnicodeString::UnicodeString(const char16_t*, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3013: error: icu_60::UnicodeString::UnicodeString(const uint16_t*)
../deps/icu-small/source/common/unicode/unistr.h:2996: error: icu_60::UnicodeString::UnicodeString(const char16_t*)
../deps/icu-small/source/common/unicode/unistr.h:2984: error: icu_60::UnicodeString::UnicodeString(UChar32)
../deps/icu-small/source/common/unicode/unistr.h:2973: error: icu_60::UnicodeString::UnicodeString(char16_t)
../deps/icu-small/source/common/unicode/unistr.h:2962: error: icu_60::UnicodeString::UnicodeString(int32_t, UChar32, int32_t)
../deps/icu-small/source/common/unicode/unistr.h:3910: error: icu_60::UnicodeString::UnicodeString()
../deps/icu-small/source/common/unicode/unistr.h:3918: error: expected initializer before ‘)’ token
../deps/icu-small/source/common/unicode/unistr.h:3922: error: expected ‘)’ before ‘,’ token
../deps/icu-small/source/common/unicode/unistr.h:3922: error: ‘icu_60::int32_t’ declared as an ‘inline’ variable
../deps/icu-small/source/common/unicode/unistr.h:3922: error: expected initializer before ‘)’ token
../deps/icu-small/source/common/unicode/unistr.h:3934: error: ‘int32_t’ does not name a type
../deps/icu-small/source/common/unicode/unistr.h:3941: error: ‘int32_t’ does not name a type
../deps/icu-small/source/common/unicode/unistr.h:3946: error: ‘int32_t’ does not name a type
../deps/icu-small/source/common/unicode/unistr.h:3952: error: ‘int32_t’ does not name a type
../deps/icu-small/source/common/unicode/unistr.h: In member function ‘const char16_t* icu_60::UnicodeString::getBuffer() const’:
../deps/icu-small/source/common/unicode/unistr.h:3975: error: ‘nullptr’ was not declared in this scope
../deps/icu-small/source/common/unicode/unistr.h: At global scope:
../deps/icu-small/source/common/unicode/unistr.h:3987: error: ‘icu_60::UnicodeString::doCompare’ declared as an ‘inline’ variable
../deps/icu-small/source/common/unicode/unistr.h:3987: error: ‘int8_t icu_60::UnicodeString::doCompare’ is not a static member of ‘class icu_60::UnicodeString’
../deps/icu-small/source/common/unicode/unistr.h:3987: error: expected ‘)’ before ‘start’
../deps/icu-small/source/common/unicode/unistr.h:3988: error: expected ‘)’ before ‘thisLength’
../deps/icu-small/source/common/unicode/unistr.h:3989: error: expected primary-expression before ‘const’
../deps/icu-small/source/common/unicode/unistr.h:3990: error: expected ‘)’ before ‘srcStart’
../deps/icu-small/source/common/unicode/unistr.h:3991: error: expected ‘)’ before ‘srcLength’
../deps/icu-small/source/common/unicode/unistr.h:3991: error: initializer expression list treated as compound expression
../deps/icu-small/source/common/unicode/unistr.h:3991: warning: left-hand operand of comma has no effect
../deps/icu-small/source/common/unicode/unistr.h:3991: error: expected ‘,’ or ‘;’ before ‘const’
../deps/icu-small/source/common/ures_cnv.cpp:78: error: expected ‘}’ at end of input
../deps/icu-small/source/common/ures_cnv.cpp:78: error: expected ‘}’ at end of input
../deps/icu-small/source/common/unicode/unistr.h:1755: warning: inline function ‘int32_t icu_60::UnicodeString::length() const’ used but never defined
make[1]: *** [/usr/local/src/node-v9.7.1/out/Release/obj.target/icuucx/deps/icu-small/source/common/ures_cnv.o] Error 1
rm a5c278cd213bbd4cab873a29634fa71da95829b2.intermediate
make[1]: Leaving directory `/usr/local/src/node-v9.7.1/out'
make: *** [node] Error 2
注1:我下载了node版本9.7.1
使用较低版本的节点时,我不会收到这些错误。
注2:在步骤7(./configure)
我收到此警告:
WARNING: C++ compiler too old, need g++ 4.9.4 or clang++ 3.4.2 (CXX=g++)