bitpay / node-bitpay-client

A Node.js module and command line client for interacting with BitPay's Cryptographically Secure API
102 stars 95 forks source link

[ISSUE] Error while npm install on Mac #108

Open afraz-khan opened 4 years ago

afraz-khan commented 4 years ago

Hi , I am unable to install bitpay-rest on my mac. "npm install bitpay-rest" is throwing an error when building secp256k1. Have a look on logs

Afraz-imac:api ahmad.afraz$ cd /Users/ahmad.afraz/Desktop/btpay_poc Afraz-imac:btpay_poc ahmad.afraz$ npm install bitpay-rest npm WARN deprecated request@2.87.0: request has been deprecated, see https://github.com/request/request/issues/3142

bignum@0.13.1 install /Users/ahmad.afraz/Desktop/btpay_poc/node_modules/bignum node-gyp rebuild

CXX(target) Release/obj.target/bignum/bignum.o SOLINK_MODULE(target) Release/bignum.node

secp256k1@1.1.5 install /Users/ahmad.afraz/Desktop/btpay_poc/node_modules/secp256k1 node-gyp rebuild

CXX(target) Release/obj.target/secp256k1/functions.o In file included from ../functions.cc:5: .././async.h:45:15: warning: 'Call' is deprecated [-Wdeprecated-declarations] callback->Call(3, argv); ^ Please if someone encountered this issue and solved then tell me the solution. Thanks.

zalimander commented 4 years ago

The problem comes from bitauth@^0.3.2 using secp256k1@=1.1.5, which doesn't build on Node v12. You can either downgrade to v11, or do some monkey patching with Yarn 2.0 and a resolution for bitpay-rest/bitauth to the master branch of BitAuth. I'd like to see this fixed though, as Node 12 is current LTS. Here's my patched fork, but it won't be updated if there are any new changes here: zalimander/node-bitpay-client#81c704e