realm / realm-js

Realm is a mobile database: an alternative to SQLite & key-value stores
https://realm.io
Apache License 2.0
5.8k stars 576 forks source link

Run `npm install --save realm` error #1924

Closed aiynmm closed 6 years ago

aiynmm commented 6 years ago

Goals

install successfully

Expected Results

install successfully

Actual Results

Here is the log!

realm@2.12.0 install /Users/yangtun/rnworkspace/HealthManager/node_modules/realm node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://static.realm.io/node-pre-gyp/2.12.0/realm-v2.12.0-node-v64-darwin-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for realm@2.12.0 and node@10.1.0 (node-v64 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/yangtun/rnworkspace/HealthManager/node_modules/realm/vendor/realm-mac-x64 (node:24061) ExperimentalWarning: The fs.promises API is experimental Resolved requirements: { SYNC_SERVER_FOLDER: 'sync', SYNC_ARCHIVE: 'realm-sync-node-cocoa-3.7.0.tar.gz', SYNC_ARCHIVE_ROOT: 'realm-sync-node-cocoa-3.7.0' } No lockfile found at the target, proceeding. Download url: https://static.realm.io/downloads/sync/realm-sync-node-cocoa-3.7.0.tar.gz Downloading realm-sync-node-cocoa-3.7.0.tar.gz [=======================================] (543k) Extracting realm-sync-node-cocoa-3.7.0.tar.gz => /Users/yangtun/rnworkspace/HealthManager/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/placeholder.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/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/sync/partial_sync.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_user.o CXX(target) Release/obj.target/object-store/src/object-store/src/sync/sync_session.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 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:29: ../src/node/node_class.hpp:306:25: error: no member named 'Callee' in 'v8::FunctionCallbackInfo' F(isolate, info.Callee(), info.This(), arguments.size(), arguments.data(), return_value);

../src/node/node_class.hpp:224:36: error: no viable conversion from 'const typename Types::PropertyGetterCallback' (aka 'void (*const)(Local, const PropertyCallbackInfo &)') to 'Local' target->SetAccessor(prop_name, property.getter, property.setter ? property.setter : set_r...

../src/node/node_class.hpp:139:9: note: in instantiation of function template specialization 'realm::node::ObjectWrap<realm::js::RealmClass

::setup_property' requested here setup_property(constructor, pair.first, pair.second);

../src/js_realm.hpp:383:68: note: in instantiation of member function 'realm::node::ObjectWrap<realm::js::RealmClass >::create_constructor' requested here FunctionType realm_constructor = ObjectWrap<T, RealmClass>::create_constructor(ctx);

../src/node/node_init.cpp:27:72: note: in instantiation of member function 'realm::js::RealmClass::create_constructor' requested here v8::Local realm_constructor = js::RealmClass::create_constructor(isolate);

/Users/yangtun/.node-gyp/10.1.0/include/node/v8.h:202:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const typename Types::PropertyGetterCallback' (aka 'void (*const)(Local, const PropertyCallbackInfo &)') to 'const v8::Local &' for 1st argument class Local {

/Users/yangtun/.node-gyp/10.1.0/include/node/v8.h:202:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'const typename Types::PropertyGetterCallback' (aka 'void (const)(Local, const PropertyCallbackInfo &)') to 'v8::Local &&' for 1st argument /Users/yangtun/.node-gyp/10.1.0/include/node/v8.h:206:13: note: candidate template ignored: could not match 'Local' against 'void ()(v8::Local, const v8::PropertyCallbackInfo &)' V8_INLINE Local(Local S that)

/Users/yangtun/.node-gyp/10.1.0/include/node/v8.h:3215:43: note: passing argument to parameter 'name' here Local context, Local name,

/Users/yangtun/.node-gyp/10.1.0/include/node/v8.h:213:5: error: assigning to 'v8::Context ' from incompatible type 'v8::String ' TYPE_CHECK(T, S);

/Users/yangtun/.node-gyp/10.1.0/include/node/v8.h:167:39: note: expanded from macro 'TYPE_CHECK' (static_cast<T volatile>(0)) = static_cast<S>(0); \

../src/node/node_class.hpp:224:25: note: in instantiation of function template specialization 'v8::Local::Local' requested here target->SetAccessor(prop_name, property.getter, property.setter ? property.setter : set_r...

../src/node/node_class.hpp:139:9: note: in instantiation of function template specialization 'realm::node::ObjectWrap<realm::js::RealmClass

::setup_property' requested here setup_property(constructor, pair.first, pair.second);

../src/js_realm.hpp:383:68: note: in instantiation of member function 'realm::node::ObjectWrap<realm::js::RealmClass >::create_constructor' requested here FunctionType realm_constructor = ObjectWrap<T, RealmClass>::create_constructor(ctx);

../src/node/node_init.cpp:27:72: note: in instantiation of member function 'realm::js::RealmClass::create_constructor' requested here v8::Local realm_constructor = js::RealmClass::create_constructor(isolate);

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:224:25: error: no viable conversion from 'Local' to 'Local' target->SetAccessor(prop_name, property.getter, property.setter ? property.setter : set_r...

../src/node/node_class.hpp:139:9: note: in instantiation of function template specialization 'realm::node::ObjectWrap<realm::js::CollectionClass

::setup_property' requested here setup_property(constructor, pair.first, pair.second);

../src/js_realm.hpp:384:78: note: in instantiation of member function 'realm::node::ObjectWrap<realm::js::CollectionClass >::create_constructor' requested here FunctionType collection_constructor = ObjectWrap<T, CollectionClass>::create_constructor(ctx);

../src/node/node_init.cpp:27:72: note: in instantiation of member function 'realm::js::RealmClass::create_constructor' requested here v8::Local realm_constructor = js::RealmClass::create_constructor(isolate);

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:258:23) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:235:12) gyp ERR! System Darwin 17.6.0 gyp ERR! command "/usr/local/Cellar/node/10.1.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/yangtun/rnworkspace/HealthManager/node_modules/realm/compiled/node-v64_darwin_x64/realm.node" "--module_name=realm" "--module_path=/Users/yangtun/rnworkspace/HealthManager/node_modules/realm/compiled/node-v64_darwin_x64" gyp ERR! cwd /Users/yangtun/rnworkspace/HealthManager/node_modules/realm gyp ERR! node -v v10.1.0 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/10.1.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/yangtun/rnworkspace/HealthManager/node_modules/realm/compiled/node-v64_darwin_x64/realm.node --module_name=realm --module_path=/Users/yangtun/rnworkspace/HealthManager/node_modules/realm/compiled/node-v64_darwin_x64' (1) node-pre-gyp ERR! stack at ChildProcess. (/Users/yangtun/rnworkspace/HealthManager/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:957:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:246:5) node-pre-gyp ERR! System Darwin 17.6.0 node-pre-gyp ERR! command "/usr/local/Cellar/node/10.1.0/bin/node" "/Users/yangtun/rnworkspace/HealthManager/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /Users/yangtun/rnworkspace/HealthManager/node_modules/realm node-pre-gyp ERR! node -v v10.1.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/10.1.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/yangtun/rnworkspace/HealthManager/node_modules/realm/compiled/node-v64_darwin_x64/realm.node --module_name=realm --module_path=/Users/yangtun/rnworkspace/HealthManager/node_modules/realm/compiled/node-v64_darwin_x64' (1) npm WARN eslint-plugin-react-native@3.2.1 requires a peer of eslint@^3.17.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! realm@2.12.0 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the realm@2.12.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Steps to Reproduce

Run npm install --save realm

Code Sample

Version of Realm and Tooling

reyn-nova commented 6 years ago

@aiynmm I was facing this problem, I fix it by reinstalling node and using node 8.11.3, the fallback to build is still showing but it will not give you the error later

kneth commented 6 years ago

It's a duplicate of #1813. The short answer is that we don't support node 10 yet. We hope that we can do so very soon.