Error: More than one instance of bitcore found with different versions

Getting this error:

/src/node_modules/bitcore-p2p/node_modules/bitcore/index.js:17
throw new Error(message);
^
Error: More than one instance of bitcore found with different versions: v0.11.7 and v0.11.7. Make sure there are no version conflicts between package.json files of your dependencies. This could also happen when a package depends on a git repository.
at Object.<anonymous> (/src/node_modules/bitcore-p2p/node_modules/bitcore/index.js:17:9)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/src/node_modules/bitcore-p2p/index.js:1:77)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)

Solution 1:

Temporary workaround:

var bitcore = require('bitcore');
delete global._bitcore;

Solution 2:

~/.nvm/versions/node/v4.8.3/lib/node_modules/bitcore/node_modules/insight-api/node_modules/bitcore-lib/index.js

line 7:
bitcore.versionGuard = function(version) {
Change it to:
bitcore.versionGuard = function(version) { return;

Written by

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store