diff --git a/lib/storage.js b/lib/storage.js index 057ce9109..06714883a 100644 --- a/lib/storage.js +++ b/lib/storage.js @@ -469,7 +469,7 @@ Storage.prototype.get_package = function(name, options, callback) { if (!~whitelist.indexOf(i)) delete result[i] } - result['dist-tags'].latest = Object.keys(result.versions).sort(semver.compare) + result['dist-tags'].latest = Object.keys(result.versions).sort(semver.compareLoose) for (var i in result['dist-tags']) { if (Array.isArray(result['dist-tags'][i])) { result['dist-tags'][i] = result['dist-tags'][i][result['dist-tags'][i].length-1] @@ -508,7 +508,7 @@ Storage._merge_versions = function(local, up) { } if (local['dist-tags'][i].indexOf(up['dist-tags'][i]) === -1) { local['dist-tags'][i].push(up['dist-tags'][i]) - local['dist-tags'][i].sort(semver.compare) + local['dist-tags'][i].sort(semver.compareLoose) } } }