diff --git a/src/fetch.ts b/src/fetch.ts index bdb93527f4..c4299d7ff4 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -127,6 +127,7 @@ export default async function fetch ( pkg, storeIndex: options.storeIndex, verifyStoreIntegrity: options.verifyStoreIntegrity, + prefix: options.prefix, }) } @@ -156,6 +157,7 @@ function fetchToStore (opts: { pkg?: Package, storeIndex: Store, verifyStoreIntegrity: boolean, + prefix: string, }): { fetchingFiles: Promise, fetchingPkg: Promise, @@ -228,6 +230,7 @@ function fetchToStore (opts: { pkgId: opts.pkgId, storePath: opts.storePath, offline: opts.offline, + prefix: opts.prefix, }) }(), // removing only the folder with the unpacked files diff --git a/src/fetchResolution.ts b/src/fetchResolution.ts index 51787c81cb..f04cc5046e 100644 --- a/src/fetchResolution.ts +++ b/src/fetchResolution.ts @@ -20,6 +20,7 @@ export type FetchOptions = { got: Got, storePath: string, offline: boolean, + prefix: string, } export type PackageDist = { @@ -79,7 +80,7 @@ function execGit (args: string[], opts?: Object) { export function fetchFromTarball (dir: string, dist: PackageDist, opts: FetchOptions) { if (dist.tarball.startsWith('file:')) { - dist = Object.assign({}, dist, {tarball: dist.tarball.slice(5)}) + dist = Object.assign({}, dist, {tarball: path.join(opts.prefix, dist.tarball.slice(5))}) return fetchFromLocalTarball(dir, dist) } else { return fetchFromRemoteTarball(dir, dist, opts)