From e3857f255bd117fec3853d96d1a8735843e8c137 Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Sun, 8 Apr 2018 19:00:05 -0700 Subject: [PATCH] Make private packages work as expected --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index a3558d5..67e4c10 100644 --- a/index.js +++ b/index.js @@ -127,10 +127,11 @@ const getMostRecent = async ({full, scope}, distTag) => { const registryAuthToken = require('registry-auth-token'); const authInfo = registryAuthToken(regURL, {recursive: true}); - ({version} = loadPackage(url, authInfo)); + const spec = await loadPackage(url, authInfo); + version = spec['dist-tags'].latest; + } else { + throw err; } - - throw err; } return version;