From 5180dfdb47681b64907e6148ecbede2cb727a0bf Mon Sep 17 00:00:00 2001 From: Chris Campbell Date: Tue, 27 Sep 2022 16:25:49 -0700 Subject: [PATCH] fix: only report error for install deps step if exit code is non-zero --- packages/create/src/step-deps.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/create/src/step-deps.ts b/packages/create/src/step-deps.ts index 18fffed4..f63ec917 100644 --- a/packages/create/src/step-deps.ts +++ b/packages/create/src/step-deps.ts @@ -47,8 +47,13 @@ export async function chooseInstallDeps(projDir: string, args: Arguments, pkgMan installSpinner.text = `${installingPackagesMsg}\n${bold(`[${pkgManager}]`)} ${data}` }) installExec.on('error', error => reject(error)) - installExec.on('exit', code => reject(`Install failed (code=${code})`)) - installExec.on('close', () => resolve()) + installExec.on('close', code => { + if (code !== 0) { + reject(`Install failed (code=${code})`) + } else { + resolve() + } + }) }) installSpinner.text = green('Packages installed!') installSpinner.succeed()