openchain / openchain-js

JavaScript Openchain client library for Node.js and the browser
https://www.openchain.org/
Apache License 2.0
75 stars 39 forks source link

Export the bitcore class inside the openchain class #4

Closed alexvicegrab closed 6 years ago

alexvicegrab commented 7 years ago

This is done in order to prevent the following error:

…Error: More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.
    at Object.bitcore.versionGuard (/usr/lib/node_modules/bitcore-lib/index.js:12:11)
    at Object.<anonymous> (/usr/lib/node_modules/bitcore-lib/index.js:15:9)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at repl:1:12
alexvicegrab commented 7 years ago

Probably better to include openchain as a peerDependency instead as suggested in:

https://github.com/bitpay/bitcore-lib/issues/21

alexvicegrab commented 7 years ago

Updated pull request with better solution of adding bitcore-lib as a peerDependency, which solves the loading of bitcore-lib and bitcore-mnemonic.

alexvicegrab commented 6 years ago

Closing, as there is no activity in this repository, fix is present in aidtechnology/openchain nonetheless.