From d93af78c5518a042470abdb7e3d817726445aa3c Mon Sep 17 00:00:00 2001 From: Marco Sirabella Date: Sat, 27 Mar 2021 15:44:00 -0700 Subject: [PATCH] Explicitly add stream to cache Pacote doesn't do this automatically anymore Closes npm/pacote#73 & Closes npm/cli#2160 --- lib/cache.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/cache.js b/lib/cache.js index 43902f43bbee1..a26a9b4261c51 100644 --- a/lib/cache.js +++ b/lib/cache.js @@ -105,12 +105,10 @@ with --force.`) log.silly('cache add', 'spec', spec) - // we ask pacote for the thing, and then just throw the data - // away so that it tee-pipes it into the cache like it does - // for a normal request. await pacote.tarball.stream(spec, stream => { stream.resume() - return stream.promise() + return cacache.put.stream(this.npm.config.get('cache'), stream) + .pipe(stream).promise() }, this.npm.flatOptions) }