diff --git a/lib/local-storage.js b/lib/local-storage.js index 08b5955cb..764feafd1 100644 --- a/lib/local-storage.js +++ b/lib/local-storage.js @@ -151,10 +151,17 @@ Storage.prototype.update_versions = function(name, newdata, callback) { } } for (var tag in newdata['dist-tags']) { - // if tag is updated to reference latter version, that's fine - var need_change = - (data['dist-tags'][tag] == null) || - (!semver.gte(newdata['dist-tags'][tag], data['dist-tags'][tag])) + if (!Array.isArray(data['dist-tags'][tag]) || data['dist-tags'][tag].length != newdata['dist-tags'][tag].length) { + // backward compat + var need_change = true + } else { + for (var i=0; i