diff --git a/lib/common b/lib/common index 42292eadb1..4fa4347f6c 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 42292eadb1679ed9fad2c7ebab8b3f65257ba3b8 +Subproject commit 4fa4347f6c2f65611ea82d20e2c1c3010eb7b45b diff --git a/lib/services/pacote-service.ts b/lib/services/pacote-service.ts index d15350dacc..52f8a87eba 100644 --- a/lib/services/pacote-service.ts +++ b/lib/services/pacote-service.ts @@ -22,11 +22,16 @@ export class PacoteService implements IPacoteService { _.extend(extractOptions, options); } - const source = pacote.tarball.stream(packageName, { cache: await this.$npm.getCachePath() }); - const destination = tar.x(extractOptions); - source.pipe(destination); - + const cache = await this.$npm.getCachePath(); return new Promise((resolve, reject) => { + const source = pacote.tarball.stream(packageName, { cache }); + source.on("error", (err: Error) => { + reject(err); + }); + + const destination = tar.x(extractOptions); + source.pipe(destination); + destination.on("error", (err: Error) => reject(err)); destination.on("finish", () => resolve()); });