Browse Source

Merge pull request #1167 from maraoz/fix/version-checker

fix version check
patch-2
Esteban Ordano 10 years ago
parent
commit
19d92ea330
  1. 8
      index.js

8
index.js

@ -1,17 +1,17 @@
var bitcore = module.exports;
// module information
bitcore.version = 'v'+require('./package.json').version;
bitcore.version = 'v' + require('./package.json').version;
var inBrowser = typeof process === 'undefined' || typeof process.versions === 'undefined';
if ((inBrowser && window._bitcore) || (!inBrowser && global._bitcore)) {
var versions = bitcore.version + ' and ' + inBrowser ? window._bitcore : global._bitcore;
var versions = bitcore.version + ' and ' + (inBrowser ? window._bitcore : global._bitcore);
var message = 'More than one instance of bitcore found with different versions: ' + versions;
if (inBrowser) {
message += '. Make sure any scripts included don\'t contain their own bitcore bundle.';
} else {
message += '. 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.';
message += '. 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.';
}
throw new Error(message);

Loading…
Cancel
Save