【React-Native】realmインストール時に起きたエラー対処方法

Android
fancycrave1 / Pixabay

React-Nativeでrealmをインストールした時に起きたエラー。

shimizuutanoAir:breakdown shimizu$ npm install realm --save> fsevents@1.2.9 install /Users/shimizu/workspace/breakdown/node_modules/fsevents
> node install

node-pre-gyp WARN Using request for node-pre-gyp https download 
[fsevents] Success: "/Users/shimizu/workspace/breakdown/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node" is installed via remote

> realm@2.29.2 install /Users/shimizu/workspace/breakdown/node_modules/realm
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://static.realm.io/node-pre-gyp/2.29.2/realm-v2.29.2-node-v72-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for realm@2.29.2 and node@12.5.0 (node-v72 ABI, unknown) (falling back to source compile with node-gyp) 
  TOUCH Release/obj.target/OpenSSL.stamp
  ACTION binding_gyp_vendored_realm_target_download_realm /Users/shimizu/workspace/breakdown/node_modules/realm/vendor/realm-mac-x64
Resolved requirements: {
  SYNC_SERVER_FOLDER: 'sync',
  SYNC_ARCHIVE: 'realm-sync-node-cocoa-4.7.3.tar.gz',
  SYNC_ARCHIVE_ROOT: 'realm-sync-node-cocoa-4.7.3'
}
No lockfile found at the target, proceeding.
Download url: https://static.realm.io/downloads/sync/realm-sync-node-cocoa-4.7.3.tar.gz
Downloading realm-sync-node-cocoa-4.7.3.tar.gz [=======================================================] (7150k)
Extracting realm-sync-node-cocoa-4.7.3.tar.gz => /Users/shimizu/workspace/breakdown/node_modules/realm/vendor/realm-mac-x64
Success
  TOUCH Release/obj.target/vendored-realm.stamp
  TOUCH Release/obj.target/realm-core.stamp
  TOUCH Release/obj.target/realm-sync.stamp
  CXX(target) Release/obj.target/object-store/src/object-store/src/binding_callback_thread_observer.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/collection_notifications.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/index_set.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/list.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/object.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/object_schema.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/object_store.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/placeholder.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/results.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/schema.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/shared_realm.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/thread_safe_reference.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/impl/collection_change_builder.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/impl/collection_notifier.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/impl/list_notifier.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/impl/object_notifier.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/impl/primitive_list_notifier.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/impl/realm_coordinator.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/impl/results_notifier.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/impl/transact_log_handler.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/impl/weak_realm_notifier.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/util/uuid.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/impl/apple/external_commit_helper.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/impl/apple/keychain_helper.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/sync/impl/apple/network_reachability_observer.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/sync/impl/apple/system_configuration.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/util/fifo.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/server/adapter.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/server/admin_realm.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/server/global_notifier.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/sync/impl/sync_file.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/sync/impl/sync_metadata.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/sync/impl/work_queue.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/sync/partial_sync.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/sync/async_open_task.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/sync/sync_config.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/sync/sync_manager.o
  CXX(target) Release/obj.target/object-store/src/object-store/src/sync/sync_session.o
../src/object-store/src/sync/sync_session.cpp:567:17: warning: enumeration value 'http_tunnel_failed' not handled in
      switch [-Wswitch]
        switch (static_cast(error_code.value())) {
                ^
../src/object-store/src/sync/sync_session.cpp:567:17: note: add missing switch cases
        switch (static_cast(error_code.value())) {
                 ^
 1 warning generated.
   CXX(target) Release/obj.target/object-store/src/object-store/src/sync/sync_user.o
   LIBTOOL-STATIC Release/object-store.a
   CXX(target) Release/obj.target/realm/src/js_realm.o
   CXX(target) Release/obj.target/realm/src/node/node_init.o
 In file included from ../src/node/node_init.cpp:19:
 In file included from ../src/node/node_init.hpp:21:
 In file included from ../src/node/node_string.hpp:21:
 ../src/node/node_types.hpp:52:42: error: no type named 'NamedPropertyGetterCallback' in namespace 'v8'; did you mean
       'IndexPropertyGetterCallback'?
     using StringPropertyGetterCallback = v8::NamedPropertyGetterCallback;
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                          IndexPropertyGetterCallback
 ../src/node/node_types.hpp:50:11: note: 'IndexPropertyGetterCallback' declared here
     using IndexPropertyGetterCallback = Nan::IndexGetterCallback;
           ^
 ../src/node/node_types.hpp:53:42: error: no type named 'NamedPropertySetterCallback' in namespace 'v8'; did you mean
       'IndexPropertySetterCallback'?
     using StringPropertySetterCallback = v8::NamedPropertySetterCallback;
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                          IndexPropertySetterCallback
 ../src/node/node_types.hpp:51:11: note: 'IndexPropertySetterCallback' declared here
     using IndexPropertySetterCallback = Nan::IndexSetterCallback;
           ^
 ../src/node/node_types.hpp:54:50: error: no type named 'NamedPropertyEnumeratorCallback' in namespace 'v8'; did you
       mean 'IndexedPropertyEnumeratorCallback'?
     using StringPropertyEnumeratorCallback = v8::NamedPropertyEnumeratorCallback;
                                              ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                  IndexedPropertyEnumeratorCallback
 /Users/shimizu/Library/Caches/node-gyp/12.5.0/include/node/v8.h:5788:16: note: 
       'IndexedPropertyEnumeratorCallback' declared here
 typedef void (*IndexedPropertyEnumeratorCallback)(
                ^
 In file included from ../src/node/node_init.cpp:19:
 In file included from ../src/node/node_init.hpp:21:
 ../src/node/node_string.hpp:51:32: error: too few arguments to function call, single argument 'isolate' was not
       specified m_str.resize(s->Utf8Length());
                 ~~~~~~~~~~~~~ ^
/Users/shimizu/Library/Caches/node-gyp/12.5.0/include/node/v8.h:2678:3: note: 'Utf8Length' declared here
  int Utf8Length(Isolate* isolate) const;
  ^
In file included from ../src/node/node_init.cpp:19:
In file included from ../src/node/node_init.hpp:21:
../src/node/node_string.hpp:53:18: error: cannot initialize a parameter of type 'v8::Isolate *' with an rvalue of
      type 'std::__1::basic_string, std::__1::allocator>::value_type *'
      (aka 'char *')
    s->WriteUtf8(&m_str[0], m_str.size(), 0, flags);
                 ^~~~~~~~~
/Users/shimizu/Library/Caches/node-gyp/12.5.0/include/node/v8.h:2738:26: note: passing argument to parameter
      'isolate' here
  int WriteUtf8(Isolate* isolate, char* buffer, int length = -1,
                         ^
In file included from ../src/node/node_init.cpp:19:
In file included from ../src/node/node_init.hpp:24:
../src/node/node_object.hpp:33:57: error: no type named 'ExternalOneByteStringResourceImpl' in namespace 'v8'; did
      you mean 'Nan::ExternalOneByteStringResource'?
        node_key = v8::String::NewExternal(isolate, new v8::ExternalOneByteStringResourceImpl(key.data(), key...
                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                        Nan::ExternalOneByteStringResource
../../nan/nan.h:191:5: note: 'Nan::ExternalOneByteStringResource' declared here
    ExternalOneByteStringResource;
    ^
In file included from ../src/node/node_init.cpp:19:
In file included from ../src/node/node_init.hpp:24:
../src/node/node_object.hpp:33:61: error: allocating an object of abstract class type
      'Nan::ExternalOneByteStringResource' (aka 'v8::String::ExternalOneByteStringResource')
        node_key = v8::String::NewExternal(isolate, new v8::ExternalOneByteStringResourceImpl(key.data(), key...
                                                            ^
/Users/shimizu/Library/Caches/node-gyp/12.5.0/include/node/v8.h:2854:25: note: unimplemented pure virtual
      method 'data' in 'ExternalOneByteStringResource'
    virtual const char* data() const = 0;
                        ^
/Users/shimizu/Library/Caches/node-gyp/12.5.0/include/node/v8.h:2856:20: note: unimplemented pure virtual
      method 'length' in 'ExternalOneByteStringResource'
    virtual size_t length() const = 0;
                   ^
In file included from ../src/node/node_init.cpp:19:
In file included from ../src/node/node_init.hpp:24:
../src/node/node_object.hpp:108:40: error: no matching member function for call to 'ToString'
        names.push_back(array->Get(i)->ToString());
                        ~~~~~~~~~~~~~~~^~~~~~~~
/Users/shimizu/Library/Caches/node-gyp/12.5.0/include/node/v8.h:2528:44: note: candidate function not viable:
      requires single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal ToString(
                                           ^
/Users/shimizu/Library/Caches/node-gyp/12.5.0/include/node/v8.h:2544:31: note: candidate function not viable:
      requires single argument 'isolate', but no arguments were provided
                Local ToString(Isolate* isolate) const);
                               ^
 In file included from ../src/node/node_init.cpp:19:
 In file included from ../src/node/node_init.hpp:25:
 ../src/node/node_function.hpp:41:19: error: no member named 'GetCallingContext' in 'v8::Isolate'; did you mean
       'GetCurrentContext'?
     if (!isolate->GetCallingContext().IsEmpty()) {
                  ^~~~~~~~~~~~~~~~~
                  GetCurrentContext
/Users/shimizu/Library/Caches/node-gyp/12.5.0/include/node/v8.h:7917:18: note: 'GetCurrentContext' declared
      here
  Local GetCurrentContext();
                  ^
 In file included from ../src/node/node_init.cpp:19:
 In file included from ../src/node/node_init.hpp:26:
 ../src/node/node_value.hpp:152:19: error: no matching member function for call to 'ToString'
     return value->ToString();
           ~~~~~~~^~~~~~~~
/Users/shimizu/Library/Caches/node-gyp/12.5.0/include/node/v8.h:2528:44: note: candidate function not viable:
      requires single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal ToString(
                                           ^
/Users/shimizu/Library/Caches/node-gyp/12.5.0/include/node/v8.h:2544:31: note: candidate function not viable:
      requires single argument 'isolate', but no arguments were provided
                Local ToString(Isolate* isolate) const);
                               ^
 In file included from ../src/node/node_init.cpp:19:
 In file included from ../src/node/node_init.hpp:29:
 ../src/node/node_class.hpp:191:23: error: no member named 'SetNamedPropertyHandler' in 'v8::ObjectTemplate'; did you
       mean 'SetIndexedPropertyHandler'? instance_tpl->SetNamedPropertyHandler(string_accessor.getter ? string_accessor.getter : get_nonexiste...
                      ^~~~~~~~~~~~~~~~~~~~~~~
                      SetIndexedPropertyHandler
/Users/shimizu/Library/Caches/node-gyp/12.5.0/include/node/v8.h:6323:8: note: 'SetIndexedPropertyHandler'
      declared here
  void SetIndexedPropertyHandler(
       ^
In file included from ../src/node/node_init.cpp:19:
In file included from ../src/node/node_init.hpp:29:
In file included from ../src/node/node_class.hpp:23:
../src/js_class.hpp:92:17: error: no type named 'StringPropertyGetterCallback' in 'realm::node::Types'
    typename T::StringPropertyGetterCallback getter;
    ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/node/node_class.hpp:368:16: note: in instantiation of template class
      'realm::js::StringPropertyType' requested here
template
               ^
In file included from ../src/node/node_init.cpp:19:
In file included from ../src/node/node_init.hpp:29:
In file included from ../src/node/node_class.hpp:23:
../src/js_class.hpp:93:17: error: no type named 'StringPropertySetterCallback' in 'realm::node::Types'
    typename T::StringPropertySetterCallback setter;
    ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/node/node_init.cpp:19:
In file included from ../src/node/node_init.hpp:29:
../src/node/node_class.hpp:373:10: error: called object type 'int' is not a function or function pointer
        F(isolate, info.This(), property, return_value);
        ~^
14 errors generated.
make: *** [Release/obj.target/realm/src/node/node_init.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:196:23)
gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/Cellar/node/12.5.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/shimizu/workspace/breakdown/node_modules/realm/compiled/node-v72_darwin_x64/realm.node" "--module_name=realm" "--module_path=/Users/shimizu/workspace/breakdown/node_modules/realm/compiled/node-v72_darwin_x64" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /Users/shimizu/workspace/breakdown/node_modules/realm
gyp ERR! node -v v12.5.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/12.5.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/shimizu/workspace/breakdown/node_modules/realm/compiled/node-v72_darwin_x64/realm.node --module_name=realm --module_path=/Users/shimizu/workspace/breakdown/node_modules/realm/compiled/node-v72_darwin_x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack     at ChildProcess. (/Users/shimizu/workspace/breakdown/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
 node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
 node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
 node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
 node-pre-gyp ERR! System Darwin 18.6.0
 node-pre-gyp ERR! command "/usr/local/Cellar/node/12.5.0/bin/node" "/Users/shimizu/workspace/breakdown/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
 node-pre-gyp ERR! cwd /Users/shimizu/workspace/breakdown/node_modules/realm
 node-pre-gyp ERR! node -v v12.5.0
 node-pre-gyp ERR! node-pre-gyp -v v0.11.0
 node-pre-gyp ERR! not ok 
 Failed to execute '/usr/local/Cellar/node/12.5.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/shimizu/workspace/breakdown/node_modules/realm/compiled/node-v72_darwin_x64/realm.node --module_name=realm --module_path=/Users/shimizu/workspace/breakdown/node_modules/realm/compiled/node-v72_darwin_x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
 npm ERR! code ELIFECYCLE
 npm ERR! errno 1
 npm ERR! realm@2.29.2 install: `node-pre-gyp install --fallback-to-build`
 npm ERR! Exit status 1
 npm ERR! 
 npm ERR! Failed at the realm@2.29.2 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/shimizu/.npm/_logs/2019-08-17T11_27_33_604Z-debug.log
 shimizuutanoAir:breakdown shimizu$ node-pre-gyp install --fallback-to-build
 -bash: node-pre-gyp: command not found
 shimizuutanoAir:breakdown shimizu$ npm install realm@2.0.7 --save
 npm WARN deprecated hawk@3.1.3: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
 npm WARN deprecated sntp@1.0.9: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
 npm WARN deprecated cryptiles@2.0.5: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
 npm WARN deprecated hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
 npm WARN deprecated boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).> lzma-native@3.0.8 install /Users/shimizu/workspace/breakdown/node_modules/lzma-native
> node-pre-gyp install --fallback-to-build && node node_modules/rimraf/bin.js build

node-pre-gyp ERR! Tried to download(404): https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v3.0.8-node-v72-darwin-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for lzma-native@3.0.8 and node@12.5.0 (node-v72 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Tried to download(undefined): https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v3.0.8-node-v72-darwin-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for lzma-native@3.0.8 and node@12.5.0 (node-v72 ABI, unknown) (falling back to source compile with node-gyp) 
  ACTION binding_gyp_liblzma_target_build .
cd . && /bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
make  all-recursive
Making all in lib
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
	  cat ../xz-5.2.3/lib/getopt.in.h; \
	} > getopt.h-t
mv -f getopt.h-t getopt.h
make  all-am
gcc -DHAVE_CONFIG_H -I. -I../xz-5.2.3/lib -I..    -D_THREAD_SAFE -pthread -fvisibility=hidden -fPIC  -MT getopt.o -MD -MP -MF .deps/getopt.Tpo -c -o getopt.o ../xz-5.2.3/lib/getopt.c
mv -f .deps/getopt.Tpo .deps/getopt.Po
gcc -DHAVE_CONFIG_H -I. -I../xz-5.2.3/lib -I..    -D_THREAD_SAFE -pthread -fvisibility=hidden -fPIC  -MT getopt1.o -MD -MP -MF .deps/getopt1.Tpo -c -o getopt1.o ../xz-5.2.3/lib/getopt1.c
mv -f .deps/getopt1.Tpo .deps/getopt1.Po
rm -f libgnu.a
ar cru libgnu.a  getopt.o getopt1.o
ranlib libgnu.a
Making all in src
Making all in liblzma
Making all in api
make[5]: Nothing to be done for `all'.
/bin/sh ../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../xz-5.2.3/src/liblzma -I../..  -I../../xz-5.2.3/src/liblzma/api -I../../xz-5.2.3/src/liblzma/common -I../../xz-5.2.3/src/liblzma/check -I../../xz-5.2.3/src/liblzma/lz -I../../xz-5.2.3/src/liblzma/rangecoder -I../../xz-5.2.3/src/liblzma/lzma -I../../xz-5.2.3/src/liblzma/delta -I../../xz-5.2.3/src/liblzma/simple -I../../xz-5.2.3/src/common -DTUKLIB_SYMBOL_PREFIX=lzma_  -D_THREAD_SAFE -pthread -fvisibility=hidden -fPIC  -MT liblzma_la-tuklib_physmem.lo -MD -MP -MF .deps/liblzma_la-tuklib_physmem.Tpo -c -o liblzma_la-tuklib_physmem.lo `test -f '../common/tuklib_physmem.c' || echo '../../xz-5.2.3/src/liblzma/'`../common/tuklib_physmem.c
/bin/sh: ../../libtool: No such file or directory
make[5]: *** [liblzma_la-tuklib_physmem.lo] Error 127
make[4]: *** [all-recursive] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [.] Error 2
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:196:23)
gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/Cellar/node/12.5.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/shimizu/workspace/breakdown/node_modules/lzma-native/binding-v3.0.8-node-v72-darwin-x64/lzma_native.node" "--module_name=lzma_native" "--module_path=/Users/shimizu/workspace/breakdown/node_modules/lzma-native/binding-v3.0.8-node-v72-darwin-x64"
gyp ERR! cwd /Users/shimizu/workspace/breakdown/node_modules/lzma-native
gyp ERR! node -v v12.5.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/12.5.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/shimizu/workspace/breakdown/node_modules/lzma-native/binding-v3.0.8-node-v72-darwin-x64/lzma_native.node --module_name=lzma_native --module_path=/Users/shimizu/workspace/breakdown/node_modules/lzma-native/binding-v3.0.8-node-v72-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess. (/Users/shimizu/workspace/breakdown/node_modules/lzma-native/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
node-pre-gyp ERR! System Darwin 18.6.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/12.5.0/bin/node" "/Users/shimizu/workspace/breakdown/node_modules/lzma-native/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/shimizu/workspace/breakdown/node_modules/lzma-native
node-pre-gyp ERR! node -v v12.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/Cellar/node/12.5.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/shimizu/workspace/breakdown/node_modules/lzma-native/binding-v3.0.8-node-v72-darwin-x64/lzma_native.node --module_name=lzma_native --module_path=/Users/shimizu/workspace/breakdown/node_modules/lzma-native/binding-v3.0.8-node-v72-darwin-x64' (1)
Traceback (most recent call last):fo lifecycle lzma-native@3.0.8~install: Failed to exec install script
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 16, in 
    sys.exit(gyp.script_main())
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
    return main(sys.argv[1:])
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
    return gyp_main(args)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 532, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2220, in GenerateOutput
    os.path.dirname(makefile_path))
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py", line 24, in __call__
    result = self.func(*args)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py", line 143, in RelativePath
    path = os.path.realpath(path)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 376, in realpath
    return abspath(path)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 364, in abspath
    cwd = os.getcwd()
OSError: [Errno 2] No such file or directory
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:344:16)
gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/Cellar/node/12.5.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/shimizu/workspace/breakdown/node_modules/lzma-native/binding-v3.0.8-node-v72-darwin-x64/lzma_native.node" "--module_name=lzma_native" "--module_path=/Users/shimizu/workspace/breakdown/node_modules/lzma-native/binding-v3.0.8-node-v72-darwin-x64"
gyp ERR! cwd /Users/shimizu/workspace/breakdown/node_modules/lzma-native
gyp ERR! node -v v12.5.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok 
npm WARN eslint-plugin-react@7.12.4 requires a peer of eslint@^3.0.0 || ^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-react-native@3.6.0 requires a peer of eslint@^3.17.0 || ^4 || ^5 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lzma-native@3.0.8 install: `node-pre-gyp install --fallback-to-build && node node_modules/rimraf/bin.js build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the lzma-native@3.0.8 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/shimizu/.npm/_logs/2019-08-17T11_31_17_796Z-debug.log

結論、realmはまだnodeのversion12に対応していないために起きた事象のようです。
なのでnodeをダウングレードして、再度インストールをしましょう。

ダウングレードをする方法は、つぎの通りです。

shimizuAir:breakdown shimizu$ npm install -g n
 /usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
+ n@6.0.0
added 1 package from 4 contributors in 0.965s
shimizuAir:breakdown shimizu$ 
shimizuAir:breakdown shimizu$ 
shimizuAir:breakdown shimizu$ 
shimizuAir:breakdown shimizu$ sudo n 10.15.0
Password:

  installing : node-v10.15.0
       mkdir : /usr/local/n/versions/node/10.15.0
       fetch : https://nodejs.org/dist/v10.15.0/node-v10.15.0-darwin-x64.tar.gz
   installed : v10.15.0 (with npm 6.4.1)

コメント

タイトルとURLをコピーしました