Skip to content

Commit d93af78

Browse files
committed
Explicitly add stream to cache
Pacote doesn't do this automatically anymore Closes npm/pacote#73 & Closes #2160
1 parent ffead4a commit d93af78

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/cache.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,10 @@ with --force.`)
105105

106106
log.silly('cache add', 'spec', spec)
107107

108-
// we ask pacote for the thing, and then just throw the data
109-
// away so that it tee-pipes it into the cache like it does
110-
// for a normal request.
111108
await pacote.tarball.stream(spec, stream => {
112109
stream.resume()
113-
return stream.promise()
110+
return cacache.put.stream(this.npm.config.get('cache'), stream)
111+
.pipe(stream).promise()
114112
}, this.npm.flatOptions)
115113
}
116114

0 commit comments

Comments
 (0)