From 265150208f1351f0d785c1aa7df6626f3a718bce Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Fri, 3 Aug 2018 11:58:11 +0300 Subject: [PATCH] fix: Unable to create project from local path of template v2 `pacote` package does not work very well with relative paths, so ensure we pass full path to the `extractPackage` method. When trying to pass `.tgz` with relative path for template and the `.tgz` is located next to `.git` dir, the `pacote` package tries to download the repository instead of using the local .tgz package. Once full path is passed, it works correctly. --- lib/services/pacote-service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/services/pacote-service.ts b/lib/services/pacote-service.ts index ac4f5d9e99..a69f12481f 100644 --- a/lib/services/pacote-service.ts +++ b/lib/services/pacote-service.ts @@ -29,6 +29,10 @@ export class PacoteService implements IPacoteService { _.extend(extractOptions, options); } + if (this.$fs.exists(packageName)) { + packageName = path.resolve(packageName); + } + const cache = await this.$npm.getCachePath(); return new Promise((resolve, reject) => { const source = pacote.tarball.stream(packageName, { cache });