Skip to content

Commit 7ae0697

Browse files
author
DimitarTachev
committed
fix: handle invalid runtime versions
1 parent 695fb7e commit 7ae0697

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

lib/services/pacote-service.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@ export class PacoteService implements IPacoteService {
2222
_.extend(extractOptions, options);
2323
}
2424

25-
const source = pacote.tarball.stream(packageName, { cache: await this.$npm.getCachePath() });
26-
const destination = tar.x(extractOptions);
27-
source.pipe(destination);
28-
25+
const cache = await this.$npm.getCachePath();
2926
return new Promise<void>((resolve, reject) => {
27+
const source = pacote.tarball.stream(packageName, { cache });
28+
source.on("error", (err: Error) => {
29+
reject(err);
30+
});
31+
32+
const destination = tar.x(extractOptions);
33+
source.pipe(destination);
34+
3035
destination.on("error", (err: Error) => reject(err));
3136
destination.on("finish", () => resolve());
3237
});

0 commit comments

Comments
 (0)