Problem installing @walletconnect/react-native-dapp package

725 Views Asked by At

I want to use walletconnect in my react native app and had setup everything based on the @walletconnect/react-native-dapp package. I followed many articles to make it work.I search it on google and found no result.It seems that error is regarding better-sqlite3. This is the error i got.

error /Users/Shaw/Project/Hercules/node_modules/better-sqlite3: 
Command failed.

Exit code: 1
Command: prebuild-install || npm run build-release
Arguments: 
Directory: /Users/Shaw/Project/Hercules/node_modules/better-sqlite3
Output:
prebuild-install warn install No prebuilt binaries found (target=19.3.0 runtime=node 
arch=arm64 libc= platform=darwin)

./src/util/binder.lzz:37:51: error: no member named 'CreationContext' in 'v8::Object'
v8::Local<v8::Context> ctx = obj->CreationContext();


[email protected] build-release
node-gyp rebuild --release

gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info find Python using Python version 3.10.9 found at "/opt/homebrew/opt/[email protected]/bin/python3.10"
gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.10
gyp info spawn args [
gyp info spawn args   '/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/Shaw/Project/Hercules/node_modules/better-sqlite3/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/Shaw/Library/Caches/node-gyp/19.3.0',
gyp info spawn args   '-Dnode_gyp_dir=/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/Shaw/Library/Caches/node-gyp/19.3.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/Shaw/Project/Hercules/node_modules/better-sqlite3',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  TOUCH ba23eeee118cd63e16015df367567cb043fed872.intermediate
  ACTION deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3 ba23eeee118cd63e16015df367567cb043fed872.intermediate
  TOUCH Release/obj.target/deps/locate_sqlite3.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
  LIBTOOL-STATIC Release/sqlite3.a
  CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
In file included from ../src/better_sqlite3.cpp:4:
In file included from ./src/better_sqlite3.lzz:11:
In file included from /Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/node.h:73:
In file included from /Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8.h:24:
In file included from /Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-array-buffer.h:12:
In file included from /Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-local-handle.h:12:
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:476:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
SHARED_EXTERNAL_POINTER_TAGS(CHECK_SHARED_EXTERNAL_POINTER_TAGS)
                             ^
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:476:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:476:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:476:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:476:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:477:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
PER_ISOLATE_EXTERNAL_POINTER_TAGS(CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS)
                                  ^
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:477:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:477:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:477:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:477:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:477:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:477:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:477:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:477:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:477:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:477:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:658:61: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
    static_assert(kJSObjectType + 1 == kFirstJSApiObjectType);
                                                            ^
                                                            , ""
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:659:55: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
    static_assert(kJSObjectType < kLastJSApiObjectType);
                                                      ^
                                                      , ""
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-internal.h:660:63: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
    static_assert(kFirstJSApiObjectType < kLastJSApiObjectType);
                                                              ^
                                                              , ""
In file included from ../src/better_sqlite3.cpp:4:
In file included from ./src/better_sqlite3.lzz:11:
In file included from /Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/node.h:73:
In file included from /Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8.h:24:
In file included from /Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-array-buffer.h:13:
In file included from /Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-object.h:9:
/Users/Shaw/Library/Caches/node-gyp/19.3.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'?
  template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
                                       ~~~~~^~~~~~~~~~~~~~~~~~~~~
                                            is_lvalue_reference
/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
struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
                            ^
In file included from ../src/better_sqlite3.cpp:4:
In file included from ./src/better_sqlite3.lzz:11:
In file included from /Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/node.h:73:
In file included from /Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8.h:24:
In file included from /Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-array-buffer.h:13:
In file included from /Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-object.h:9:
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-maybe.h:106:69: error: expected '(' for function-style cast or type construction
  template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/Shaw/Library/Caches/node-gyp/19.3.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'?
template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
                                     ~~~~~^~~~~~~~~~~~~~~~~~~~~
                                          is_lvalue_reference
/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
struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
                            ^
In file included from ../src/better_sqlite3.cpp:4:
In file included from ./src/better_sqlite3.lzz:11:
In file included from /Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/node.h:73:
In file included from /Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8.h:24:
In file included from /Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-array-buffer.h:13:
In file included from /Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-object.h:9:
/Users/Shaw/Library/Caches/node-gyp/19.3.0/include/node/v8-maybe.h:123:67: error: expected '(' for function-style cast or type construction
template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
./src/util/macros.lzz:157:21: error: no member named 'AccessorSignature' in namespace 'v8'
                v8::AccessorSignature::New(isolate, recv)
                ~~~~^
./src/objects/database.lzz:180:21: warning: variable 'status' set but not used [-Wunused-but-set-variable]
                int status = sqlite3_db_config(db_handle, SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, 1, NULL);
                    ^
./src/util/binder.lzz:37:51: error: no member named 'CreationContext' in 'v8::Object'
                v8::Local<v8::Context> ctx = obj->CreationContext();
                                             ~~~~~^
20 warnings and 6 errors generated.
make: *** [Release/obj.target/better_sqlite3/src/better_sqlite3.o] Error 1
rm ba23eeee118cd63e16015df367567cb043fed872.intermediate
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:293:12)
gyp ERR! System Darwin 22.1.0
gyp ERR! command "/opt/homebrew/Cellar/node/19.3.0/bin/node" "/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /Users/Shaw/Project/Hercules/node_modules/better-sqlite3
gyp ERR! node -v v19.3.0
gyp ERR! node-gyp -v v9.3.0
gyp ERR! not ok

I do followed these steps

npx react-native init appName --template react-native-template-typescript
cd appName
npm i --save react-native-crypto react-native-randombytes  
cd ios/ && pod install && cd .. 
npm i --save-dev rn-nodeify@latest  
./node_modules/.bin/rn-nodeify --install  
npm i --save node-libs-browser  
npm i base-64 
#Modify metro.config.js
#Modify shim.js. 
#Add shim import to App.tsx

None of the above thing worked.

Any help would be appreciated

1

There are 1 best solutions below

0
On