OpenCC icon indicating copy to clipboard operation
OpenCC copied to clipboard

Fails to build on Node 20 MacOS Ventura

Open joelpickup opened this issue 2 years ago • 2 comments

For clarity, I saw the same on MacOS Monterey with clang version 13.

Versions

Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
yarn -v 
3.6.1
node -v
v20.5.0

Logs


# This file contains the result of Yarn building a package (opencc@npm:1.1.3)
# Script name: install

node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | darwin | arm64
node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp info check checked for "[REDACTED]/node_modules/opencc/build/Release/opencc.node" (not found)
node-pre-gyp http GET https://github.com/BYVoid/OpenCC/releases/download/1.1.3/opencc-v1.1.3-node-v115-darwin-arm64.tar.gz
node-pre-gyp http 404 https://github.com/BYVoid/OpenCC/releases/download/1.1.3/opencc-v1.1.3-node-v115-darwin-arm64.tar.gz
node-pre-gyp WARN Tried to download(404): https://github.com/BYVoid/OpenCC/releases/download/1.1.3/opencc-v1.1.3-node-v115-darwin-arm64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v115 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp http 404 status code downloading tarball https://github.com/BYVoid/OpenCC/releases/download/1.1.3/opencc-v1.1.3-node-v115-darwin-arm64.tar.gz 
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info ok 
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info find Python using Python version 3.9.16 found at "/Users/joel/.pyenv/versions/3.9.16/bin/python3"
gyp info spawn /Users/joel/.pyenv/versions/3.9.16/bin/python3
gyp info spawn args [
gyp info spawn args   '[REDACTED]/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '[REDACTED]/node_modules/opencc/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '[REDACTED]/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/joel/Library/Caches/node-gyp/20.5.0',
gyp info spawn args   '-Dnode_gyp_dir=[REDACTED]/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/joel/Library/Caches/node-gyp/20.5.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=[REDACTED]/node_modules/opencc',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info ok 
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  COPY Release/hk2s.json
  COPY Release/hk2t.json
  COPY Release/jp2t.json
  COPY Release/s2hk.json
  COPY Release/s2t.json
  COPY Release/s2tw.json
  COPY Release/s2twp.json
  COPY Release/t2hk.json
  COPY Release/t2jp.json
  COPY Release/t2s.json
  COPY Release/t2tw.json
  COPY Release/tw2s.json
  COPY Release/tw2sp.json
  COPY Release/tw2t.json
  TOUCH Release/obj.target/configs.stamp
  CXX(target) Release/obj.target/opencc/node/marisa.o
  CXX(target) Release/obj.target/opencc/node/opencc.o
In file included from ../node/opencc.cc:2:
In file included from ../../nan/nan.h:60:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/node.h:73:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8.h:24:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-array-buffer.h:12:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-local-handle.h:12:
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
SHARED_EXTERNAL_POINTER_TAGS(CHECK_SHARED_EXTERNAL_POINTER_TAGS)
                             ^
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
PER_ISOLATE_EXTERNAL_POINTER_TAGS(CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS)
                                  ^
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:693:61: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
    static_assert(kJSObjectType + 1 == kFirstJSApiObjectType);
                                                            ^
                                                            , ""
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:694:55: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
    static_assert(kJSObjectType < kLastJSApiObjectType);
                                                      ^
                                                      , ""
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:695:63: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
    static_assert(kFirstJSApiObjectType < kLastJSApiObjectType);
                                                              ^
                                                              , ""
In file included from ../node/opencc.cc:2:
In file included from ../../nan/nan.h:60:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/node.h:73:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8.h:24:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-array-buffer.h:13:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-object.h:9:
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-maybe.h:106:45: error: no template named 'is_lvalue_reference_v' in namespace 'std'; did you mean 'is_lvalue_reference'?
  template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
                                       ~~~~~^~~~~~~~~~~~~~~~~~~~~
                                            is_lvalue_reference
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_reference.h:26:29: note: 'is_lvalue_reference' declared here
struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
                            ^
In file included from ../node/opencc.cc:2:
In file included from ../../nan/nan.h:60:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/node.h:73:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8.h:24:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-array-buffer.h:13:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-object.h:9:
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-maybe.h:106:69: error: expected '(' for function-style cast or type construction
  template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-maybe.h:123:43: error: no template named 'is_lvalue_reference_v' in namespace 'std'; did you mean 'is_lvalue_reference'?
template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
                                     ~~~~~^~~~~~~~~~~~~~~~~~~~~
                                          is_lvalue_reference
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_reference.h:26:29: note: 'is_lvalue_reference' declared here
struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
                            ^
In file included from ../node/opencc.cc:2:
In file included from ../../nan/nan.h:60:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/node.h:73:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8.h:24:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-array-buffer.h:13:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-object.h:9:
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-maybe.h:123:67: error: expected '(' for function-style cast or type construction
template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
In file included from ../node/opencc.cc:2:
In file included from ../../nan/nan.h:60:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/node.h:73:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8.h:33:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-function.h:11:
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-function-callback.h:151:66: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
                kReturnValueDefaultValueIndex - kReturnValueIndex);
                                                                 ^
                                                                 , ""
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-function-callback.h:153:50: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
                kIsolateIndex - kReturnValueIndex);
                                                 ^
                                                 , ""
In file included from ../node/opencc.cc:2:
../../nan/nan.h:686:39: warning: 'IdleNotificationDeadline' is deprecated: Use MemoryPressureNotification() to influence the GC schedule. [-Wdeprecated-declarations]
    return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
                                      ^
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-isolate.h:1291:3: note: 'IdleNotificationDeadline' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON(
  ^
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8config.h:550:39: note: expanded from macro 'V8_DEPRECATE_SOON'
# define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
                                      ^
23 warnings and 4 errors generated.
make: *** [Release/obj.target/opencc/node/opencc.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit ([REDACTED]/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
gyp ERR! System Darwin 22.6.0
gyp ERR! command "/Users/joel/.nvm/versions/node/v20.5.0/bin/node" "[REDACTED]/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=[REDACTED]/node_modules/opencc/build/Release/opencc.node" "--module_name=opencc" "--module_path=[REDACTED]/node_modules/opencc/build/Release" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v115"
gyp ERR! cwd [REDACTED]/node_modules/opencc
gyp ERR! node -v v20.5.0
gyp ERR! node-gyp -v v9.4.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/joel/.nvm/versions/node/v20.5.0/bin/node [REDACTED]/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=[REDACTED]/node_modules/opencc/build/Release/opencc.node --module_name=opencc --module_path=[REDACTED]/node_modules/opencc/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v115' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> ([REDACTED]/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1105:16)
node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
node-pre-gyp ERR! System Darwin 22.6.0
node-pre-gyp ERR! command "/Users/joel/.nvm/versions/node/v20.5.0/bin/node" "[REDACTED]/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd [REDACTED]/node_modules/opencc
node-pre-gyp ERR! node -v v20.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.14.0
node-pre-gyp ERR! not ok 
Failed to execute '/Users/joel/.nvm/versions/node/v20.5.0/bin/node [REDACTED]/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=[REDACTED]/node_modules/opencc/build/Release/opencc.node --module_name=opencc --module_path=[REDACTED]/node_modules/opencc/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v115' (1)
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | darwin | arm64
[opencc] Removing "[REDACTED]/node_modules/opencc/build/Release"
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info ok 
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info find Python using Python version 3.9.16 found at "/Users/joel/.pyenv/versions/3.9.16/bin/python3"
gyp info spawn /Users/joel/.pyenv/versions/3.9.16/bin/python3
gyp info spawn args [
gyp info spawn args   '[REDACTED]/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '[REDACTED]/node_modules/opencc/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '[REDACTED]/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/joel/Library/Caches/node-gyp/20.5.0',
gyp info spawn args   '-Dnode_gyp_dir=[REDACTED]/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/joel/Library/Caches/node-gyp/20.5.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=[REDACTED]/node_modules/opencc',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info ok 
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  COPY Release/hk2s.json
  COPY Release/hk2t.json
  COPY Release/jp2t.json
  COPY Release/s2hk.json
  COPY Release/s2t.json
  COPY Release/s2tw.json
  COPY Release/s2twp.json
  COPY Release/t2hk.json
  COPY Release/t2jp.json
  COPY Release/t2s.json
  COPY Release/t2tw.json
  COPY Release/tw2s.json
  COPY Release/tw2sp.json
  COPY Release/tw2t.json
  TOUCH Release/obj.target/configs.stamp
  CXX(target) Release/obj.target/opencc/node/marisa.o
  CXX(target) Release/obj.target/opencc/node/opencc.o
In file included from ../node/opencc.cc:2:
In file included from ../../nan/nan.h:60:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/node.h:73:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8.h:24:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-array-buffer.h:12:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-local-handle.h:12:
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
SHARED_EXTERNAL_POINTER_TAGS(CHECK_SHARED_EXTERNAL_POINTER_TAGS)
                             ^
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
PER_ISOLATE_EXTERNAL_POINTER_TAGS(CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS)
                                  ^
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:693:61: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
    static_assert(kJSObjectType + 1 == kFirstJSApiObjectType);
                                                            ^
                                                            , ""
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:694:55: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
    static_assert(kJSObjectType < kLastJSApiObjectType);
                                                      ^
                                                      , ""
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-internal.h:695:63: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
    static_assert(kFirstJSApiObjectType < kLastJSApiObjectType);
                                                              ^
                                                              , ""
In file included from ../node/opencc.cc:2:
In file included from ../../nan/nan.h:60:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/node.h:73:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8.h:24:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-array-buffer.h:13:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-object.h:9:
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-maybe.h:106:45: error: no template named 'is_lvalue_reference_v' in namespace 'std'; did you mean 'is_lvalue_reference'?
  template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
                                       ~~~~~^~~~~~~~~~~~~~~~~~~~~
                                            is_lvalue_reference
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_reference.h:26:29: note: 'is_lvalue_reference' declared here
struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
                            ^
In file included from ../node/opencc.cc:2:
In file included from ../../nan/nan.h:60:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/node.h:73:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8.h:24:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-array-buffer.h:13:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-object.h:9:
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-maybe.h:106:69: error: expected '(' for function-style cast or type construction
  template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-maybe.h:123:43: error: no template named 'is_lvalue_reference_v' in namespace 'std'; did you mean 'is_lvalue_reference'?
template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
                                     ~~~~~^~~~~~~~~~~~~~~~~~~~~
                                          is_lvalue_reference
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_reference.h:26:29: note: 'is_lvalue_reference' declared here
struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
                            ^
In file included from ../node/opencc.cc:2:
In file included from ../../nan/nan.h:60:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/node.h:73:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8.h:24:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-array-buffer.h:13:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-object.h:9:
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-maybe.h:123:67: error: expected '(' for function-style cast or type construction
template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
In file included from ../node/opencc.cc:2:
In file included from ../../nan/nan.h:60:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/node.h:73:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8.h:33:
In file included from /Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-function.h:11:
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-function-callback.h:151:66: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
                kReturnValueDefaultValueIndex - kReturnValueIndex);
                                                                 ^
                                                                 , ""
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-function-callback.h:153:50: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
                kIsolateIndex - kReturnValueIndex);
                                                 ^
                                                 , ""
In file included from ../node/opencc.cc:2:
../../nan/nan.h:686:39: warning: 'IdleNotificationDeadline' is deprecated: Use MemoryPressureNotification() to influence the GC schedule. [-Wdeprecated-declarations]
    return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
                                      ^
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8-isolate.h:1291:3: note: 'IdleNotificationDeadline' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON(
  ^
/Users/joel/Library/Caches/node-gyp/20.5.0/include/node/v8config.h:550:39: note: expanded from macro 'V8_DEPRECATE_SOON'
# define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
                                      ^
23 warnings and 4 errors generated.
make: *** [Release/obj.target/opencc/node/opencc.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit ([REDACTED]/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
gyp ERR! System Darwin 22.6.0
gyp ERR! command "/Users/joel/.nvm/versions/node/v20.5.0/bin/node" "[REDACTED]/node_modules/node-gyp/bin/node-gyp.js" "build" "--module=[REDACTED]/node_modules/opencc/build/Release/opencc.node" "--module_name=opencc" "--module_path=[REDACTED]/node_modules/opencc/build/Release" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v115"
gyp ERR! cwd [REDACTED]/node_modules/opencc
gyp ERR! node -v v20.5.0
gyp ERR! node-gyp -v v9.4.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/joel/.nvm/versions/node/v20.5.0/bin/node [REDACTED]/node_modules/node-gyp/bin/node-gyp.js build --module=[REDACTED]/node_modules/opencc/build/Release/opencc.node --module_name=opencc --module_path=[REDACTED]/node_modules/opencc/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v115' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> ([REDACTED]/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1105:16)
node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
node-pre-gyp ERR! System Darwin 22.6.0
node-pre-gyp ERR! command "/Users/joel/.nvm/versions/node/v20.5.0/bin/node" "[REDACTED]/node_modules/node-pre-gyp/bin/node-pre-gyp" "rebuild"
node-pre-gyp ERR! cwd [REDACTED]/node_modules/opencc
node-pre-gyp ERR! node -v v20.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.14.0
node-pre-gyp ERR! not ok 
Failed to execute '/Users/joel/.nvm/versions/node/v20.5.0/bin/node [REDACTED]/node_modules/node-gyp/bin/node-gyp.js build --module=[REDACTED]/node_modules/opencc/build/Release/opencc.node --module_name=opencc --module_path=[REDACTED]/node_modules/opencc/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v115' (1)

joelpickup avatar Aug 10 '23 08:08 joelpickup

I am also seeing this same issue.

Also, relates to #783

Possibly related to #667 #614

coderfin avatar Oct 23 '23 04:10 coderfin

For all forks stucks here:

In node_modules/opencc/node/global.gypi, find:

["OS=='mac'", {
  'xcode_settings': {
    'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
    'MACOSX_DEPLOYMENT_TARGET': '10.7',
    'OTHER_CPLUSPLUSFLAGS': ["-std=c++14", "-stdlib=libc++"],
    'OTHER_LDFLAGS': ["-stdlib=libc++"]
  }
}],

Modify the -std=c++14 to -std=c++17, then in node_modules/opencc folder, run npm run install.

I am no c++ expert, but the error is basically trying to tell you, [email protected] has some c++17 code, but opencc is compiled under c++14 on MacOS, as the above config states. The version of node-gyp here is same as your Node version.

afterwind-io avatar Oct 30 '23 06:10 afterwind-io

Fixed.

BYVoid avatar Jul 26 '24 21:07 BYVoid