无法在node.js中编译本机模块

我正在尝试包括一个名为libraw的节点模块,但是它似乎在最新版本的节点(v12.x和13.x)中引发错误。我在下面看到错误跟踪信息...有什么想法吗?

> libraw@0.1.4 install /Users/michaelmichailidis/Projects/manscupianconverter/node_modules/libraw
> node-gyp rebuild

  CXX(target) Release/obj.target/libraw/vendor/libraw/internal/dcraw_common.o
  CXX(target) Release/obj.target/libraw/vendor/libraw/internal/dcraw_fileio.o
  CXX(target) Release/obj.target/libraw/vendor/libraw/internal/demosaic_packs.o
  CXX(target) Release/obj.target/libraw/vendor/libraw/src/libraw_cxx.o
  CXX(target) Release/obj.target/libraw/vendor/libraw/src/libraw_datastream.o
  CXX(target) Release/obj.target/libraw/vendor/libraw/src/libraw_c_api.o
  LIBTOOL-STATIC Release/raw.a
  CXX(target) Release/obj.target/node_libraw/node_libraw.o
In file included from ../node_libraw.cc:8:
In file included from ../vendor/libraw/libraw/libraw.h:35:
../vendor/libraw/libraw/libraw_datastream.h:119:8: warning: 'auto_ptr<std::__1::basic_streambuf<char> >' is deprecated
      [-Wdeprecated-declarations]
  std::auto_ptr<std::streambuf> f;       /* will close() automatically through dtor */
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:2080:28: note: 
      'auto_ptr<std::__1::basic_streambuf<char> >' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr
                           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1101:39: note: expanded
      from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1090:48: note: expanded
      from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^
In file included from ../node_libraw.cc:8:
In file included from ../vendor/libraw/libraw/libraw.h:35:
../vendor/libraw/libraw/libraw_datastream.h:120:8: warning: 'auto_ptr<std::__1::basic_streambuf<char> >' is deprecated
      [-Wdeprecated-declarations]
  std::auto_ptr<std::streambuf> saved_f; /* when *f is a subfile,*saved_f is the master file */
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:2080:28: note: 
      'auto_ptr<std::__1::basic_streambuf<char> >' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr
                           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1101:39: note: expanded
      from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1090:48: note: expanded
      from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^
../node_libraw.cc:28:53: error: no matching member function for call to 'ToString'
    v8::String::Utf8Value filenameFromArgs(info[0]->ToString());
                                           ~~~~~~~~~^~~~~~~~
/Users/michaelmichailidis/library/Caches/node-gyp/12.13.0/include/node/v8.h:2572:44: note: candidate function not viable: requires single
      argument 'context',but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                           ^
/Users/michaelmichailidis/library/Caches/node-gyp/12.13.0/include/node/v8.h:2588:31: note: candidate function not viable: requires single
      argument 'isolate',but no arguments were provided
                Local<String> ToString(Isolate* isolate) const);
                              ^
../node_libraw.cc:30:51: error: no matching member function for call to 'ToString'
    v8::String::Utf8Value outputFromArgs(info[1]->ToString());
                                         ~~~~~~~~~^~~~~~~~
/Users/michaelmichailidis/library/Caches/node-gyp/12.13.0/include/node/v8.h:2572:44: note: candidate function not viable: requires single
      argument 'context',but no arguments were provided
                Local<String> ToString(Isolate* isolate) const);
                              ^
../node_libraw.cc:61:17: warning: 'Call' is deprecated [-Wdeprecated-declarations]
      callback->Call(2,argv);
                ^
../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../node_libraw.cc:73:53: error: no matching member function for call to 'ToString'
    v8::String::Utf8Value filenameFromArgs(info[0]->ToString());
                                           ~~~~~~~~~^~~~~~~~
/Users/michaelmichailidis/library/Caches/node-gyp/12.13.0/include/node/v8.h:2572:44: note: candidate function not viable: requires single
      argument 'context',but no arguments were provided
                Local<String> ToString(Isolate* isolate) const);
                              ^
../node_libraw.cc:75:51: error: no matching member function for call to 'ToString'
    v8::String::Utf8Value outputFromArgs(info[1]->ToString());
                                         ~~~~~~~~~^~~~~~~~
/Users/michaelmichailidis/library/Caches/node-gyp/12.13.0/include/node/v8.h:2572:44: note: candidate function not viable: requires single
      argument 'context',but no arguments were provided
                Local<String> ToString(Isolate* isolate) const);
                              ^
../node_libraw.cc:107:17: warning: 'Call' is deprecated [-Wdeprecated-declarations]
      callback->Call(2,argv);
                ^
../../nan/nan.h:1739:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../../nan/nan.h:104:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
4 warnings and 4 errors generated.
make: *** [Release/obj.target/node_libraw/node_libraw.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/michaelmichailidis/.nvm/versions/node/v12.13.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/Users/michaelmichailidis/.nvm/versions/node/v12.13.0/bin/node" "/Users/michaelmichailidis/.nvm/versions/node/v12.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/michaelmichailidis/Projects/manscupianconverter/node_modules/libraw
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! libraw@0.1.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the libraw@0.1.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/michaelmichailidis/.npm/_logs/2019-11-04T11_01_00_456Z-debug.log
192:manscupianconverter michaelmichailidis$ clear
shixinzhijia 回答:无法在node.js中编译本机模块

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3167273.html

大家都在问