mmmagic
mmmagic copied to clipboard
MacOS Montery Error in install
Trying to get mmmagic to work. On M1 Mac.
npm install mmmagic
shows:
Debug log file below
72 error code 1
73 error path /Users/dannymiller/node_modules/mmmagic
74 error command failed
75 error command sh -c node-gyp rebuild
76 error CC(target) Release/obj.target/libmagic/deps/libmagic/src/apprentice.o
76 error CC(target) Release/obj.target/libmagic/deps/libmagic/src/apptype.o
76 error CC(target) Release/obj.target/libmagic/deps/libmagic/src/ascmagic.o
76 error CC(target) Release/obj.target/libmagic/deps/libmagic/src/cdf.o
76 error CC(target) Release/obj.target/libmagic/deps/libmagic/src/cdf_time.o
76 error CC(target) Release/obj.target/libmagic/deps/libmagic/src/compress.o
76 error CC(target) Release/obj.target/libmagic/deps/libmagic/src/der.o
76 error CC(target) Release/obj.target/libmagic/deps/libmagic/src/encoding.o
76 error CC(target) Release/obj.target/libmagic/deps/libmagic/src/fsmagic.o
76 error CC(target) Release/obj.target/libmagic/deps/libmagic/src/funcs.o
76 error CC(target) Release/obj.target/libmagic/deps/libmagic/src/is_tar.o
76 error CC(target) Release/obj.target/libmagic/deps/libmagic/src/magic.o
76 error CC(target) Release/obj.target/libmagic/deps/libmagic/src/print.o
76 error CC(target) Release/obj.target/libmagic/deps/libmagic/src/readcdf.o
76 error CC(target) Release/obj.target/libmagic/deps/libmagic/src/readelf.o
76 error CC(target) Release/obj.target/libmagic/deps/libmagic/src/softmagic.o
76 error LIBTOOL-STATIC Release/magic.a
76 error CXX(target) Release/obj.target/magic/src/binding.o
77 error gyp info it worked if it ends with ok
77 error gyp info using [email protected]
77 error gyp info using [email protected] | darwin | arm64
77 error gyp info find Python using Python version 3.11.1 found at "/Library/Frameworks/Python.framework/Versions/3.11/bin/python3"
77 error gyp info spawn /Library/Frameworks/Python.framework/Versions/3.11/bin/python3
77 error gyp info spawn args [
77 error gyp info spawn args '/Users/dannymiller/node_modules/node-gyp/gyp/gyp_main.py',
77 error gyp info spawn args 'binding.gyp',
77 error gyp info spawn args '-f',
77 error gyp info spawn args 'make',
77 error gyp info spawn args '-I',
77 error gyp info spawn args '/Users/dannymiller/node_modules/mmmagic/build/config.gypi',
77 error gyp info spawn args '-I',
77 error gyp info spawn args '/Users/dannymiller/node_modules/node-gyp/addon.gypi',
77 error gyp info spawn args '-I',
77 error gyp info spawn args '/Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/common.gypi',
77 error gyp info spawn args '-Dlibrary=shared_library',
77 error gyp info spawn args '-Dvisibility=default',
77 error gyp info spawn args '-Dnode_root_dir=/Users/dannymiller/Library/Caches/node-gyp/19.5.0',
77 error gyp info spawn args '-Dnode_gyp_dir=/Users/dannymiller/node_modules/node-gyp',
77 error gyp info spawn args '-Dnode_lib_file=/Users/dannymiller/Library/Caches/node-gyp/19.5.0/<(target_arch)/node.lib',
77 error gyp info spawn args '-Dmodule_root_dir=/Users/dannymiller/node_modules/mmmagic',
77 error gyp info spawn args '-Dnode_engine=v8',
77 error gyp info spawn args '--depth=.',
77 error gyp info spawn args '--no-parallel',
77 error gyp info spawn args '--generator-output',
77 error gyp info spawn args 'build',
77 error gyp info spawn args '-Goutput_dir=.'
77 error gyp info spawn args ]
77 error gyp info spawn make
77 error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
77 error In file included from ../src/binding.cc:1:
77 error In file included from /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/node.h:73:
77 error In file included from /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8.h:24:
77 error In file included from /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-array-buffer.h:12:
77 error In file included from /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-local-handle.h:12:
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:477:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error SHARED_EXTERNAL_POINTER_TAGS(CHECK_SHARED_EXTERNAL_POINTER_TAGS)
77 error ^
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:477:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:477:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:477:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:477:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error PER_ISOLATE_EXTERNAL_POINTER_TAGS(CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS)
77 error ^
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:659:61: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error static_assert(kJSObjectType + 1 == kFirstJSApiObjectType);
77 error ^
77 error , ""
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:660:55: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error static_assert(kJSObjectType < kLastJSApiObjectType);
77 error ^
77 error , ""
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-internal.h:661:63: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
77 error static_assert(kFirstJSApiObjectType < kLastJSApiObjectType);
77 error ^
77 error , ""
77 error In file included from ../src/binding.cc:1:
77 error In file included from /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/node.h:73:
77 error In file included from /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8.h:24:
77 error In file included from /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-array-buffer.h:13:
77 error In file included from /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-object.h:9:
77 error /Users/dannymiller/Library/Caches/node-gyp/19.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'?
77 error template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
77 error ~~~~~^~~~~~~~~~~~~~~~~~~~~
77 error is_lvalue_reference
77 error /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:910:29: note: 'is_lvalue_reference' declared here
77 error struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
77 error ^
77 error In file included from ../src/binding.cc:1:
77 error In file included from /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/node.h:73:
77 error In file included from /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8.h:24:
77 error In file included from /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-array-buffer.h:13:
77 error In file included from /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-object.h:9:
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-maybe.h:106:69: error: expected '(' for function-style cast or type construction
77 error template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
77 error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
77 error /Users/dannymiller/Library/Caches/node-gyp/19.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'?
77 error template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
77 error ~~~~~^~~~~~~~~~~~~~~~~~~~~
77 error is_lvalue_reference
77 error /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:910:29: note: 'is_lvalue_reference' declared here
77 error struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
77 error ^
77 error In file included from ../src/binding.cc:1:
77 error In file included from /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/node.h:73:
77 error In file included from /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8.h:24:
77 error In file included from /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-array-buffer.h:13:
77 error In file included from /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-object.h:9:
77 error /Users/dannymiller/Library/Caches/node-gyp/19.5.0/include/node/v8-maybe.h:123:67: error: expected '(' for function-style cast or type construction
77 error template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
77 error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
77 error 20 warnings and 4 errors generated.
77 error make: *** [Release/obj.target/magic/src/binding.o] Error 1
77 error gyp ERR! build error
77 error gyp ERR! stack Error: `make` failed with exit code: 2
77 error gyp ERR! stack at ChildProcess.onExit (/Users/dannymiller/node_modules/node-gyp/lib/build.js:203:23)
77 error gyp ERR! stack at ChildProcess.emit (node:events:512:28)
77 error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
77 error gyp ERR! System Darwin 21.6.0
77 error gyp ERR! command "/opt/homebrew/Cellar/node/19.5.0/bin/node" "/Users/dannymiller/node_modules/.bin/node-gyp" "rebuild"
77 error gyp ERR! cwd /Users/dannymiller/node_modules/mmmagic
77 error gyp ERR! node -v v19.5.0
77 error gyp ERR! node-gyp -v v9.3.1
77 error gyp ERR! not ok
78 verbose exit 1
79 timing npm Completed in 2177ms
80 verbose unfinished npm timer reify 1675280973026
81 verbose unfinished npm timer reify:build 1675280973127
82 verbose unfinished npm timer build 1675280973127
83 verbose unfinished npm timer build:deps 1675280973127
84 verbose unfinished npm timer build:run:install 1675280973128
85 verbose unfinished npm timer build:run:install:node_modules/mmmagic 1675280973128
86 verbose code 1
The errors shown come from outside of mmmagic
and are pointing to V8's headers.
Are you able to compile node.js (19.5.0) itself as-is on that same machine? The same V8 headers would be used there. If compiling node.js works fine, my only guess would be perhaps something is wrong in node-gyp, perhaps with compiler flags or something along those lines.
This error appears when rebuilding on Mac with Intel chip as well. node-gyp with Node 19.5 doesn't seem able to build it. Downgrading to Node 18.14 has solved the issue.
Out of curiosity, does applying this patch to this addon make it work on node v19.x?
diff --git a/binding.gyp b/binding.gyp
index 8280a81..495a90d 100644
--- a/binding.gyp
+++ b/binding.gyp
@@ -18,16 +18,6 @@
'dependencies': [
'deps/libmagic/libmagic.gyp:libmagic',
],
- 'conditions': [
- ['OS=="mac"', {
- 'xcode_settings': {
- 'MACOSX_DEPLOYMENT_TARGET': '10.7',
- 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
- 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++1y', # -std=gnu++1y
- 'CLANG_CXX_LIBRARY': 'libc++',
- }
- }],
- ],
},
],
}
yes, it compiles now with 20.9.0 without conditions