3

These two lines (and nothing more), create an error:

var exp = require('bitcore-explorers');
var btc = require('bitcore-lib');

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.

I could see that this issue has been documented here, as well as here, and here. I read these pages, but I am still unable to overcome the issue.

Can someone please help? How do you do when trying to import different modules of bitcore?

hartmut
  • 671
  • 5
  • 21

2 Answers2

2

I don't know if that's the right method but it does work.

delete global._bitcore
var bitcore = require('bitcore-lib')
01BTC10
  • 353
  • 4
  • 10
1

See Add this line prior bitcore definition:

Object.defineProperty(global, '_bitcore', { get(){ return undefined }, set(){} })

Taken from here.

forhas
  • 137
  • 4