From ebb3496586fb8e001ee803272eac6fc0e07e259f Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Thu, 16 Aug 2018 22:15:11 +0200 Subject: [PATCH] fix(npm): skip caching for scoped packages Ref: https://npm.community/t/scoped-packages-have-latest-version-disappear-temporarily-soon-after-publish/633/7 --- lib/datasource/npm.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/datasource/npm.js b/lib/datasource/npm.js index 317d90f4cc..e18dcc74a2 100644 --- a/lib/datasource/npm.js +++ b/lib/datasource/npm.js @@ -165,8 +165,11 @@ async function getDependency(name, retries = 5) { // Retrieve from API if not cached try { + // TODO: cache scoped packages once npmjs cache time is fixed for scoped packages + // Ref: https://npm.community/t/scoped-packages-have-latest-version-disappear-temporarily-soon-after-publish/633/7 + const useCache = !(process.env.RENOVATE_SKIP_CACHE || name.startsWith('@')); const raw = await got(pkgUrl, { - cache: process.env.RENOVATE_SKIP_CACHE ? undefined : map, + cache: useCache ? map : undefined, json: true, retries: 5, headers, -- GitLab