nodejs npm не удалось установить hdf5 - PullRequest
0 голосов
/ 07 августа 2020

Я работаю над собственным проектом реакции на ma c, и я пытаюсь установить hdf5, выполнив эту команду

Версия узла: 12.8.3

SO: Ma c Os Catalina

npm install hdf5

но Я получаю ошибку компиляции, я искал проблему в Интернете, но не смог ее исправить

вот что я получил:

clangclang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
In file included from ../src/h5ds.cc:2:
../src/file.h:11:10: fatal error: 'hdf5.h' file not found
#include "hdf5.h"
         ^~~~~~~~
In file included from ../src/h5im.cc:2:
../src/file.h:11:10: fatal error: 'hdf5.h' file not found
#include "hdf5.h"
         ^~~~~~~~
1 error generated.
1 error generated.
In file included from ../src/uint64.cc:1:
../src/uint64.hpp:24:32: error: no template named 'Handle' in namespace 'v8'
    static void Initialize(v8::Handle<v8::Object> target);
                           ~~~~^
                                                                                                                           ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/Users/ahmed/Library/Caches/node-gyp/12.18.3/include/node/v8.h:2668:44: note: candidate function not viable: requires single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                           ^
                              
../src/int64.hpp:58:149: error: no matching member function for call to 'ToString'
        std::string value = args[args.Length() - 1]->IsUndefined() ? std::string("0") : std::string(*v8::String::Utf8Value(args[args.Length() - 1]->ToString()));
                                                                                                                           ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
make: *** [Release/obj.target/h5im/src/h5im.o] Error 1
make: *** Waiting for unfinished jobs....
/Users/ahmed/Library/Caches/node-gyp/12.18.3/include/node/v8.h:2668:44: note: candidate function not viable: requires single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                           ^
make: *** [Release/obj.target/h5ds/src/h5ds.o] Error 1
In file included from ../src/uint64.cc:1:
../src/uint64.hpp:64:81: error: too few arguments to function call, single argument 'context' was not specified
        xp = new Uint64((unsigned long long)args[args.Length() - 1]->Int32Value());
                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/ahmed/Library/Caches/node-gyp/12.18.3/include/node/v8.h:2709:3: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  ^
.....

3 warnings and 8 errors generated.
3 warnings and 8 errors generated.
make: *** [Release/obj.target/h5lt/src/uint64.o] Error 1
make: *** [Release/obj.target/h5lt/src/int64.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--jobs" "max"
gyp ERR! cwd /Users/ahmed/Desktop/ReactSleepLogger/node_modules/hdf5
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN @react-native-community/cli@4.10.1 requires a peer of react-native@^0.62.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hdf5@0.3.5 install: `node-gyp rebuild --jobs max`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the hdf5@0.3.5 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

что я могу сделать, чтобы исправить проблема? есть ли другой способ использовать hdf5 с реакцией?

1 Ответ

0 голосов
/ 07 августа 2020

Вам необходимо установить hdf5 с помощью homebrew.

Попробуйте:

brew install hdf5

или

brew install homebrew/science/hdf5

Вы можете проверить, как установить brew здесь: https://brew.sh/

...