bcoin-org/bcoin

Unable to npm install dependencies (N64 error)

canIchangethispls opened this issue · 4 comments

I've installed all required tools (GCC, python, etc.)

Still receiving the following error:

gyp info it worked if it ends with ok
gyp info using node-gyp@9.0.0
gyp info using node@18.7.0 | linux | x64
gyp info find Python using Python version 3.10.4 found at "/usr/bin/python3.10"
gyp http GET https://nodejs.org/download/release/v18.7.0/node-v18.7.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v18.7.0/node-v18.7.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v18.7.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v18.7.0/SHASUMS256.txt
gyp info spawn /usr/bin/python3.10
gyp info spawn args [
gyp info spawn args   '/usr/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   '/root/backend/back-end-main/node_modules/n64/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/.cache/node-gyp/18.7.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=/root/.cache/node-gyp/18.7.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/18.7.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/root/backend/back-end-main/node_modules/n64',
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' ]
make: Entering directory '/root/backend/back-end-main/node_modules/n64/build'
  CXX(target) Release/obj.target/n64/src/n64.o
In file included from ../src/n64.cc:7:
../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)’:
../../nan/nan.h:2536:19: warning: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::Local<v8::AccessorSignature>, v8::SideEffectType, v8::SideEffectType)’ is deprecated: Do signature check in accessor [-Wdeprecated-declarations]
 2536 |   tpl->SetAccessor(
      |   ~~~~~~~~~~~~~~~~^
 2537 |       name
      |       ~~~~         
 2538 |     , getter_
      |     ~~~~~~~~~      
 2539 |     , setter_
      |     ~~~~~~~~~      
 2540 |     , obj
      |     ~~~~~          
 2541 |     , settings
      |     ~~~~~~~~~~     
 2542 |     , attribute
      |     ~~~~~~~~~~~    
 2543 |     , signature);
      |     ~~~~~~~~~~~~   
In file included from /root/.cache/node-gyp/18.7.0/include/node/v8-function.h:15,
                 from /root/.cache/node-gyp/18.7.0/include/node/v8.h:33,
                 from /root/.cache/node-gyp/18.7.0/include/node/node.h:73,
                 from ../src/n64.cc:6:
/root/.cache/node-gyp/18.7.0/include/node/v8-template.h:838:8: note: declared here
  838 |   void SetAccessor(
      |        ^~~~~~~~~~~
In file included from ../../nan/nan.h:2884,
                 from ../src/n64.cc:7:
../../nan/nan_typedarray_contents.h: In constructor ‘Nan::TypedArrayContents<T>::TypedArrayContents(v8::Local<v8::Value>)’:
../../nan/nan_typedarray_contents.h:34:43: error: ‘class v8::ArrayBuffer’ has no member named ‘GetContents’
   34 |       data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
      |                                           ^~~~~~~~~~~
../src/n64.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE N64::ToString(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/n64.cc:1126:15: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
 1126 |         fmt = "%" PRIo64;
      |               ^
../src/n64.cc:1129:15: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
 1129 |         fmt = "%" PRIu64;
      |               ^
../src/n64.cc:1132:15: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
 1132 |         fmt = "%" PRIx64;
      |               ^
make: *** [n64.target.mk:131: Release/obj.target/n64/src/n64.o] Error 1
make: Leaving directory '/root/backend/back-end-main/node_modules/n64/build'
gyp ERR! build error 

It seems like an arbitrary build error to me.. I've tried different python versions but to no avail.

see my comment here: #1046 (comment)

executing npm install in bcoin is incorrect usage, the node_modules are committed and all you need to run is npm rebuild. Can you clean the repo and try that?

Is the issue closed by updating the docs from npm install to npm rebuild?

try running npm cache clean then npm rebuild