diff --git a/lib/storage.js b/lib/storage.js index dfc17eea9..261fb837e 100644 --- a/lib/storage.js +++ b/lib/storage.js @@ -411,8 +411,8 @@ Storage.prototype.get_local = function(callback) { var getPackage = function(i) { self.local.get_package(locals[i], function(err, info) { if (!err) { - var latest = Array.isArray(info['dist-tags'].latest) - ? utils.semver_sort(info['dist-tags'].latest)[0] + var latest = Array.isArray(info['dist-tags'].latest) + ? utils.semver_sort(info['dist-tags'].latest).pop() : info['dist-tags'].latest if (info.versions[latest]) { packages.push(info.versions[latest]) @@ -548,4 +548,3 @@ Storage._merge_versions = function(local, up, config) { } module.exports = Storage -