bcoin-org / bcoin

Javascript bitcoin library for node.js and browsers
https://bcoin.io
Other
3.01k stars 811 forks source link

N64 dependency outdated? #1046

Open devesh-002 opened 2 years ago

devesh-002 commented 2 years ago

Hi, I am from Summer of Bitcoin and was trying to install bcoin using yarn as my package manager.yarn install gave me an error which redirected me to the N64 dependency showing an error at lines 1126 to 1143 in n64.cc . It seemed a simple bug so I followed this idea https://stackoverflow.com/questions/20944784/why-is-conversion-from-string-constant-to-char-valid-in-c-but-invalid-in-c and tried to fix like this

  case 8:
      {
        string str="%" PRIo64;
        strcpy(fmp,str.c_str());
        break;
      }
      case 10:
{      string  str = "%" PRIu64;
      strcpy(fmp,str.c_str());

        break;
 }     case 16:

  {      string str= "%" PRIx64;
        strcpy(fmp,str.c_str());

        break;
   }

After doing this i get a new error stating bcrypto.node module not found. I have tried to install the latest version also but cannot resolve this. Posting this issue to check if any one else is also facing the error. I don't think using yarn as a package manager should make an issue?

devesh-002 commented 2 years ago

So i tried debugging and found the issue was finally related to this issue https://stackoverflow.com/questions/69290893/getcontents-in-v8arraybuffer and was resolved when I installed the latest version of nan (v2.15.0). I hope this can be changed in the package.json :).

yarn add nan

pinheadmz commented 2 years ago

I was able to build bcoin and run all tests on OSX with node v16.4.0

You shouldn't have to install anything since we include all node_modules in the git repository now. Simply clone and run npm rebuild which will compile from source code all the native modules (like bcrypto.node)

I think keeping dependencies up to date makes sense of course, I just want to make sure there isn't some other issue going on in your environment.