Browse Source

fix version check

patch-2
Manuel Araoz 10 years ago
parent
commit
a49f0f1c4e
  1. 6
      index.js

6
index.js

@ -5,13 +5,13 @@ bitcore.version = 'v'+require('./package.json').version;
var inBrowser = typeof process === 'undefined' || typeof process.versions === 'undefined'; var inBrowser = typeof process === 'undefined' || typeof process.versions === 'undefined';
if ((inBrowser && window._bitcore) || (!inBrowser && global._bitcore)) { 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; var message = 'More than one instance of bitcore found with different versions: ' + versions;
if (inBrowser) { if (inBrowser) {
message += '. Make sure any scripts included don\'t contain their own bitcore bundle.'; message += '. Make sure any scripts included don\'t contain their own bitcore bundle.';
} else { } else {
message += '. Make sure there are no version conflicts between package.json files of your ' 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.'; 'dependencies. This could also happen when a package depends on a git repository.';
} }
throw new Error(message); throw new Error(message);

Loading…
Cancel
Save